int innerouterdouble tempint while( <nelems/ * /find initial value of while( > /decreasing huntil = /( / -sort the file for(outer=houter<nelemsouter++temp thearray[outer]inner outer/one subpass (eg while(inner - &thearray[inner- >thearray[innerthearray[inner- ]inner -hthearray[innertemp/end for ( - /decrease /end while( > /end shellsort(temp///end class arraysh ///////////////////////////////////////////////////////////////class shellsortapp public static void main(string[argsint maxsize /array size arraysh arrarr new arraysh(maxsize)/create the array for(int = <maxsizej++/fill array with /random numbers double (int)(java lang math random()* )arr insert( )arr display()/display unsorted array arr shellsort()/shell sort the array