advanced sorting listing continued nelems++/increment size //public int size(/return number of items return nelems//public void display(/displays array contents system out print(" =")for(int = <nelemsj++/for each elementsystem out print(thearray[ ")/display it system out println("")//public int partitionit(int leftint rightlong pivotint leftptr left /right of first elem int rightptr right /left of pivot while(truewhile(leftptr right &/find bigger item thearray[++leftptrpivot/(nopwhile(rightptr left &/find smaller item thearray[--rightptrpivot/(nopif(leftptr >rightptr/if pointers crossbreak/partition done else /not crossedso swap(leftptrrightptr)/swap elements /end while(truereturn leftptr/return partition /end partitionit(//public void swap(int dex int dex /swap two elements long temptemp thearray[dex ]/ into temp thearray[dex thearray[dex ]/ into thearray[dex temp/temp into