Insertion sort applied to <code>{5, 2, 4, 6, 1}</code> produces the partial pass states shown. What is the array AFTER pass 4 (the final pass)?
- A
[1, 2, 4, 6, 5]
- B
[2, 4, 5, 6, 1]
- C
[2, 1, 4, 5, 6]
- Dcheck_circle
[1, 2, 4, 5, 6]
Explanation
Pass 4 inserts 1 at the front of the sorted prefix, shifting 2,4,5,6 right by one to give the fully sorted array [1, 2, 4, 5, 6].