advanced sorting items in the right subarrayalthough they are larger than the pivotare not yet sortedso they can be moved aroundwithin the right subarraywithout affecting anything thereforeto simplify inserting the pivot in its proper placewe can simply swap the pivot ( and the left item in the right subarraywhich is this swap places the pivot in its proper position between the left and right groups the is switched to the right endbut because it remains in the right (largergroupthe partitioning is undisturbed this situation is shown in figure left subarray left subarray pivot right subarray right subarray pivot figure swapping the pivot when it' swapped into the partition' locationthe pivot is in its final resting place all subsequent activity will take place on one side of it or on the otherbut the pivot itself won' be moved (or indeed even accessedagain to incorporate the pivot selection process into our recquicksort(methodlet' make it an overt statementand send the pivot value to partitionit(as an argument here' how that lookspublic void recquicksort(int leftint rightif(right-left < /if size < return/already sorted else /size is or larger long pivot thearray[right]/rightmost item /partition range int partition partitionit(leftrightpivot)