An array holds 7, 3, 9, 2, 6. What is the order after the first pass of a bubble sort into ascending order?
- Compare 7 and 3: wrong order, swap. The array is now 3, 7, 9, 2, 6.
- Compare 7 and 9: correct order, no swap.
- Compare 9 and 2: swap. The array is now 3, 7, 2, 9, 6.
- Compare 9 and 6: swap. The array is now 3, 7, 2, 6, 9.
Answer: 3, 7, 2, 6, 9 (4 comparisons, 3 swaps, and 9 is now in its final place)