listing continued /end swap(///end class arraypar ///////////////////////////////////////////////////////////////class partitionapp public static void main(string[argsint maxsize /array size arraypar arr/reference to array arr new arraypar(maxsize)/create the array for(int = <maxsizej++/fill array with /random numbers long (int)(java lang math random()* )arr insert( )arr display()/display unsorted array long pivot /pivot value system out print("pivot is pivot)int size arr size()/partition array int partdex arr partitionit( size- pivot)system out println("partition is at index partdex)arr display()/display partitioned array /end main(the main(routine creates an arraypar object that holds items of type long the pivot value is fixed at the routine inserts random values into arraypardisplays thempartitions them by calling the partitionit(methodand displays them again here' some sample outputa= pivot is partition is at index = you can see that the partition is successfulthe first eight numbers are all smaller than the pivot value of the last eight are all larger