i and loc continue to move until i > loc
i and loc continue to move until i > loc
This happens when i points to M and loc points to D
G B C E D M P H V S ?
0 1 2 3 4 5 6 7 8 9 10
i = 5
first = 0
loc = 4
last = 9
Now exchanging a[loc] and pivot partitions a.
Previous slide
Next slide
Back to first slide
View graphic version