6 3 2 5 0 200 10 pick 6 as the pivot point, after pivotting <= 6 >= 6 /-----\ /----\ 3 2 5 0 6 200 10 ^---------pivot 0 1 2 3 4 5 6 ^---------index of pivot 6 3 2 5 0 200 10 b = 0 e = 6 i = 0 after the first inner loop, b = 5 after the second inner loop, e = 5