Quick sort : In quick sort, we will consider a pivot element and divide the array so that all the lesser element will be in left side of pivot element while all the greater element will be in right side. This process we will continue recursively until array is fully sorted. Time complexity will beO(nlogn) but in worst case when elements are in sorted order time complexity will become O(n^2) as in each call only one element will be consider as sorted and for rest again we need to follow same process. space complexity will be O(1). class QuickSort { public static void sort ( int [] array) { int n = array. length ; shuffle (array) ; sort (array , 0 , n - 1 ) ; } private static void sort ( int [] array , int lo , int hi) { if (hi <= lo) return; int j = partition (array , lo , hi) ; sort (array , lo , j - 1 ) ; sort (array , j + 1 , hi) ; } ...