Added merge sort

This commit is contained in:
Ziver Koc 2010-02-26 18:39:18 +00:00
parent c161e4bdd8
commit 7bad0e2c18
8 changed files with 171 additions and 4 deletions

View file

@ -1,4 +1,5 @@
package zutil.test;
import zutil.algo.sort.MergeSort;
import zutil.algo.sort.QuickSort;
import zutil.algo.sort.SimpleSort;
import zutil.algo.sort.sortable.SortableIntArray;
@ -20,10 +21,12 @@ public class SortTestSimple extends TestCase {
}
long time = System.currentTimeMillis();
//SimpleSort.bubbleSort(new SortableIntArray(array));
//SimpleSort.selectionSort(new SortableIntArray(array));
SimpleSort.insertionSort(new SortableIntArray(array));
//QuickSort.sort(new SortableIntArray(array));
//SimpleSort.bubbleSort( new SortableIntArray(array) );
//SimpleSort.selectionSort( new SortableIntArray(array) );
//SimpleSort.insertionSort( new SortableIntArray(array) );
//QuickSort.sort( new SortableIntArray(array) );
//MergeSort.sort( array );
MergeSort.sort( new SortableIntArray(array) );
time = System.currentTimeMillis() - time;
System.out.println("\n--------------------------------------------");