Unordered list of marks of students is given. ________ compares the adjacent elements and swap them.
Unordered list of marks of students is given. ________ compares the adjacent elements and swap them.
Solution
Bubble sort repeatedly compares each pair of adjacent elements and swaps them if they are in the wrong order. After each pass, the largest remaining element "bubbles up" to its correct position at the end of the list.
Selection sort: finds the minimum of the unsorted part and swaps it once into place, so it does not swap adjacent pairs at each comparison.
Insertion sort: picks one element and inserts it into the sorted part by shifting elements, rather than swapping adjacent pairs in repeated passes.
Quick sort: partitions the list around a pivot, comparing elements with the pivot and not with their neighbours.
Related questions:
2025: 27 May Shift 2
2026: 11 May Shift 2
2025: 22 May Shift 1