advanced sorting call ourselves to sort the left group call ourselves again to sort the right group after partitionall the items in the left subarray are smaller than all those on the right if we then sort the left subarray and sort the right subarraythe entire array will be sorted how do we sort these subarraysby calling ourself recursively the arguments to the recquicksort(method determine the left and right ends of the array (or subarrayit' supposed to sort the method first checks if this array consists of only one element if sothe array is by definition already sortedand the method returns immediately this is the base case in the recursion process if the array has two or more cellsthe algorithm calls the partitionit(methoddescribed in the preceding sectionto partition it this method returns the index number of the partitionthe left element in the right (larger keyssubarray the partition marks the boundary between the subarrays this situation is shown in figure unpartitioned array pivot left subarray left partition right subarray already sorted will be sorted by first recursive call to recquicksort(figure right will be sorted by second recursive call to recquicksort(recursive calls sort subarrays after the array is partitionedrecquicksort(calls itself recursivelyonce for the left part of its arrayfrom left to partition- and once for the rightfrom partition+ to right note that the data item at the index partition is not included in either of the recursive calls why notdoesn' it need to be sortedthe explanation lies in how the pivot value is chosen