listing continued /end swap//public int partitionit(int leftint rightlong pivotint leftptr left/right of first elem int rightptr right /left of pivot while(truewhilethearray[++leftptrpivot /find bigger /(nopwhilethearray[--rightptrpivot /find smaller /(nopif(leftptr >rightptr/if pointers crossbreak/partition done else /not crossedso swap(leftptrrightptr)/swap elements /end while(trueswap(leftptrright- )/restore pivot return leftptr/return pivot location /end partitionit(///insertion sort public void insertionsort(int leftint rightint inout/sorted on left of out for(out=left+ out<=rightout++long temp thearray[out]/remove marked item in out/start shifts at out /until one is smallerwhile(in>left &thearray[in- >tempthearray[inthearray[in- ]/shift item to right --in/go left one position thearray[intemp/insert marked item /end for /end insertionsort(///end class arrayins