Skip to main contentSkip to solution

____________ is the simplest sorting algorithm that works by repeatedly swapping the adjacent elements in case they are unordered in n-1 passes.

Solution

✅ Correct Option: 2

Bubble Sort compares each pair of adjacent elements and swaps them if they are in the wrong order. After each pass, the largest remaining element "bubbles" to its correct position at the end. For n elements, n-1 passes are enough to sort the list.


Insertion Sort: picks one element at a time and inserts it into its place in the sorted part, by shifting elements rather than repeatedly swapping adjacent pairs.

Selection Sort: finds the minimum of the unsorted part and places it at the front with a single swap per pass.

Merge Sort: a divide and conquer algorithm that splits the list and merges sorted halves, so it does not work by adjacent swaps.

Keyboard Shortcuts

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