Skip to main contentSkip to solution

Unordered list of marks of students is given. ________ compares the adjacent elements and swap them.

Solution

✅ Correct Option: 2

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.

Keyboard Shortcuts

  • Left arrow: Previous question
  • Right arrow: Next question
  • S key: Jump to solution
  • Q key: Jump to question