Skip to main contentSkip to solution

Consider a numlist = [58, 46, 63, 11, -16, 26]

What will be sequence of following elements after pass 3 of bubble sort?

(A) 46

(B) 26

(C) -16

(D) 11

Solution

✅ Correct Option: 1

Bubble sort (ascending) compares adjacent elements and swaps them if they are out of order. Each pass pushes the largest remaining element to the end.

PassList after the pass
Start58, 46, 63, 11, -16, 26
146, 58, 11, -16, 26, 63
246, 11, -16, 26, 58, 63
311, -16, 26, 46, 58, 63

After pass 3 the elements in the asked order are 11 (D), -16 (C), 26 (B), 46 (A).

Keyboard Shortcuts

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