Quicksort Split: Code
Split(First,Last)
SplitPoint := 1;
for i := 2 to n do
if L[i] < L[1] then
SplitPoint := SplitPoint + 1;
Exchange(L[SplitPoint],L[i]);
endif
endfor
Exchange(L[SplitPoint],L[1]);
return SplitPoint;
End Split
Fixed n-1 iterations
Points to last element
in “Small” section.
Else the “Big” section
gets bigger.
Make “Small” section
bigger and move key
into it.
Previous slide
Next slide
Back to first slide
View graphic version