advanced sorting it prevented leftptr running off the right end of the array if no item there was larger than pivot why can we eliminate the testbecause we selected the rightmost item as the pivotso leftptr will always stop there howeverthe test is still necessary for rightptr in the second while loop (later we'll see how this test can be eliminated as well choosing the rightmost item as the pivot is thus not an entirely arbitrary choiceit speeds up the code by removing an unnecessary test picking the pivot from some other location would not provide this advantage the quicksort workshop applet at this point you know enough about the quicksort algorithm to understand the nuances of the quicksort workshop applet the big picture for the big pictureuse the size button to set the applet to sort random barsand press the run button following the sorting processthe display will look something like figure figure the quicksort workshop applet with bars watch how the algorithm partitions the array into two partsthen sorts each of these parts by partitioning it into two partsand so oncreating smaller and smaller subarrays when the sorting process is completeeach dotted line provides visual record of one of the sorted subarrays the horizontal range of the line shows which bars were part of the subarrayand its vertical position is the pivot value (the height of the