Skip to main contentSkip to solution

If a list is having 'n' elements, then how many passes 'Selection Sort' will require to sort the list?

Solution

✅ Correct Option: 2

Selection sort picks the smallest element from the unsorted part and swaps it into its correct position, one position per pass. After n−1n-1 passes, the first n−1n-1 positions hold the correct elements, so the last element is automatically in place and no extra pass is needed.

Number of passes =n−1= \boxed{n-1}


Option 3: nn is a common trap, but the nnth pass would have only one element left to compare, so it does nothing.

Keyboard Shortcuts

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