import java.util.ArrayList; class QuickSort { public static > void sort(ArrayList a) { sort(a,0,a.size()); } private static > void sort(ArrayList a,int from,int to) { if(to>from+1) { T pivot = a.get(from); int low=from+1,high=to-1; while(low void swap(ArrayList a,int pos1,int pos2) { T temp = a.get(pos1); a.set(pos1,a.get(pos2)); a.set(pos2,temp); } }