Question:

The number of swaps made in pass 1 for the following list using Insertion sort is: \[ 9, 8, 14, 2, -8, 5 \]

Show Hint

Insertion sort compares each element with the previous ones and swaps them into the correct position.
Updated On: Apr 24, 2025
  • 0
  • 1
  • 2
  • 3
Hide Solution
collegedunia
Verified By Collegedunia

The Correct Option is C

Solution and Explanation

In the first pass of insertion sort:
- 9 and 8 swap, resulting in: 8, 9, 14, 2, -8, 5.
- 14 is already in the correct place.
- 2 and 14 swap, followed by 2 and 9 swapping.
Thus, 2 swaps are made in pass 1.
Was this answer helpful?
0
0

Questions Asked in CUET exam

View More Questions