Question

Consider the array [5, 2, 8, 1, 9]. After the first pass of Selection Sort (to find the minimum element and place it at the beginning), what will the array look like?

A [1, 2, 8, 5, 9]
B [1, 5, 8, 2, 9]
C [2, 5, 8, 1, 9]
D [5, 2, 8, 1, 9] (no change)
E [9, 5, 8, 1, 2]
Practice Next

Hey! Ask a query