Is as simple comparison-based algorithm where each pair of adjacent elements is compared and swapped if they are in the wrong order
Bubble Sort
It repeatedly steps through the list
Compares adjacent elements
Swaps them if they are in the wrong order
Bubble Sort
Where is Bubble Sort Used?
Educational Settings
Small Datasets
Debugging tools
Learning Purposes
to introduce sorting algorithms
Educational Settings
where performance is not critical
Small Datasets
where simplicity is needed
Debugging tools
to teach the concept of comparison and swapping
Learning Purposes
Is a simple comparison-based sorting algorithm that repeatedly selects the minimum element from the unsorted part of the list and places it at the beginning.
Selection Sort
It divides the array into two parts: sorted and unsorted
At each iteration, the smallest (or largest) element from the unsorted section is moved to the sorted section.
This process continues until all elements are sorted
Selection Sort
What are the Application of Selection Sort
Small Datasets
Embedded Systems
Teaching & Education
Data with high cost of swapping
Efficient for sorting a limited number of elements
Small Datasets
Low memory usage is an advantage
Embedded Systems
Embedded Systems
Easy to understand for learning sorting fundamentals
Teaching & Education
Fewer swaps compared to other basic sorts like bubble sort.
Data with high cost of swapping