Computer Applications
Answer
| Selection sort | Bubble sort |
|---|---|
| Selection Sort selects the smallest element from unsorted sub-array and swaps it with the leftmost unsorted element. | Bubble Sort compares adjacent elements and swaps them if they are in wrong order. |
| Performs lesser number of swaps to sort the same array relative to Bubble Sort | Performs more number of swaps to sort the array |
| Selection Sort is faster | Bubble Sort is slower |
Related Questions
Differentiate between Sorting and Searching
Differentiate between Linear search and Binary search
Differentiate between length and length()
Write a program in Java to store 20 numbers (even and odd numbers) in a Single Dimensional Array (SDA). Calculate and display the sum of all even numbers and all odd numbers separately.