Skip to main contentSkip to solution

Consider the 'numList' having the elements as follows:

numList =[9,8,12,1,-8,3].

What will be the partially sorted list after three complete passes of Bubble sort?

Solution

✅ Correct Option: 1

Bubble sort compares adjacent elements from the left and swaps them if the left one is larger. Each pass pushes the largest remaining element to the end.

PassList after the pass
Start[9, 8, 12, 1, -8, 3]
1[8, 9, 1, -8, 3, 12]
2[8, 1, -8, 3, 9, 12]
3[1, -8, 3, 8, 9, 12]

Option 4: this is the list after only two passes.

Options 2 and 3: they show more sorting than three passes can produce. Bubble sort moves a small element left by only one place per pass, so -8 cannot get ahead of 1 and 3 by this point.

Keyboard Shortcuts

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