Skip to main contentSkip to solution

The sorting algorithm which sorts the elements by repeatedly comparing the consecutive elements, and swapping them if they are not in proper order is called ___________.

Solution

✅ Correct Option: 1

Bubble sort repeatedly compares each pair of adjacent (consecutive) 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.


Selection sort: finds the minimum element in the unsorted part and places it at the front, instead of swapping neighbours.

Merge sort and Quick sort: divide-and-conquer methods that split the list (by halves or around a pivot) rather than comparing and swapping consecutive elements.

Keyboard Shortcuts

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