sorting is to the left of jthose elements are swapped the effect is to push large element to the right and small element to the left in the example abovei would not move and would slide over one place the situation is as follows we then swap the elements pointed to by and and repeat the process until and crossafter first swap before second swap after second swap before third swap at this stagei and have crossedso no swap is performed the final part of the partitioning is to swap the pivot element with the element pointed to by iafter swap with pivot pivot when the pivot is swapped with in the last stepwe know that every element in position must be small this is because either position contained small element