Added merge sort
This commit is contained in:
parent
c161e4bdd8
commit
7bad0e2c18
8 changed files with 171 additions and 4 deletions
|
|
@ -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--------------------------------------------");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue