Question

Consider the Quick Sort algorithm with the last element as the pivot. For the array [7, 2, 1, 6, 8, 5, 3, 4], what will be the state of the array *after the first partitioning step* if 4 is chosen as the pivot?

A [2, 1, 3, 4, 8, 5, 7, 6]
B [2, 1, 3, 4, 7, 5, 8, 6]
C [1, 2, 3, 4, 5, 6, 7, 8]
D [4, 2, 1, 6, 8, 5, 3, 7]
E [2, 1, 3, 5, 8, 7, 6, 4]
Practice Next

Hey! Ask a query