import sort.InsertionSort; import sort.QuickSort; import sort.Sort; /* * Created on 24 oct. 2004 * */ /** * @author baudon * */ public class TestSort { public static void sortAndPrint(Sort sort, Comparable [] a) { sort.doSort(a); for (int i = 0; i < a.length; i++) { System.out.print(a[i] + " "); } System.out.println(); } public static void main(String[] args) { String[] args2 = new String[args.length]; System.arraycopy(args, 0, args2, 0, args.length); sortAndPrint(new InsertionSort(), args); sortAndPrint(new QuickSort(), args2); } }