public class SortingAndSearching { /******************************************************************** Sorts the specified array of objects using the quick sort algorithm. ********************************************************************/ public void quickSort (T[] data, int min, int max) { int indexofpartition; int count = 0; if (max - min > 0) { /** Create partitions */ indexofpartition = findPartition(data, min, max); /** Sort the left side */ quickSort(data, min, indexofpartition - 1); /** Sort the right side */ quickSort(data, indexofpartition + 1, max); } } /******************************************************************** Used by the quick sort algorithm to find the partition. ********************************************************************/ private int findPartition (T[] data, int min, int max) { int left, right; T temp, partitionelement; partitionelement = data[min]; // use first element as partition left = min; right = max; while (left the partitionelement */ while (data[left].compareTo(partitionelement) <=0 && left < right) left++; /** search for an element that is < the partitionelement */ while (data[right].compareTo(partitionelement) > 0) right--; /** swap the elements */ if (left