advanced sorting listing continued ///////////////////////////////////////////////////////////////class quicksort app public static void main(string[argsint maxsize /array size arrayins arr/reference to array arr new arrayins(maxsize)/create the array for(int = <maxsizej++/fill array with /random numbers long (int)(java lang math random()* )arr insert( )arr display()/display items arr quicksort()/quicksort them arr display()/display them again /end main(using the insertion sort for small subarrays turns out to be the fastest approach on our particular installationbut it is not much faster than sorting subarrays of three or fewer cells by handas in quicksort java the numbers of comparisons and copies are reduced substantially in the quicksort phasebut are increased by an almost equal amount in the insertion sortso the time savings are not dramatic howeverthis approach is probably worthwhile if you are trying to squeeze the last ounce of performance out of quicksort insertion sort following quicksort another option is to completely quicksort the array without bothering to sort partitions smaller than the cutoff this is shown with commented-out line in the quicksort(method (if this call is usedthe call to insertionsort(should be removed from recquicksort(when quicksort is finishedthe array will be almost sorted you then apply the insertion sort to the entire array the insertion sort is supposed to operate efficiently on almost-sorted arraysand this approach is recommended by some expertsbut on our installation it runs very slowly the insertion sort appears to be happier doing lot of small sorts than one big one removing recursion another embellishment recommended by many writers is removing recursion from the quicksort algorithm this involves rewriting the algorithm to store deferred