public void recquicksort(int leftint rightif(right-left < /if size is return/it' already sorted else /size is or larger /partition range int partition partitionit(leftright)recquicksort(leftpartition- )/sort left side recquicksort(partition+ right)/sort right side as you can seethere are three basic steps partition the array or subarray into left (smaller keysand right (larger keysgroups 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 the arguments to the recquicksort(method determine the left and right ends of the array (or subarrayit' supposed to sort the method first checks whether 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 last 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 is shown in figure figure recursive calls sort subarrays