adding three-way partitioned quick sort
This commit is contained in:
@@ -82,7 +82,7 @@ public class AlgorithmTester{
|
||||
int input;
|
||||
boolean ready=false;
|
||||
boolean print=false;
|
||||
String[] sortingAlgoNames = {"bubble","selection","insertion","counting","quick","merge"};
|
||||
String[] sortingAlgoNames = {"bubble","selection","insertion","counting","quick","3-way partitioned quick","merge"};
|
||||
boolean[] sortingAlgoChoices = new boolean[sortingAlgoNames.length];
|
||||
System.out.print("\nPlease enter file name: ");
|
||||
filename = sc.next();
|
||||
@@ -131,7 +131,8 @@ public class AlgorithmTester{
|
||||
boolean insertion=sortingAlgoChoices[2];
|
||||
boolean counting=sortingAlgoChoices[3];
|
||||
boolean quick=sortingAlgoChoices[4];
|
||||
boolean merge=sortingAlgoChoices[5];
|
||||
boolean quickTWP=sortingAlgoChoices[5];
|
||||
boolean merge=sortingAlgoChoices[6];
|
||||
ArrayList<SortResult> results = new ArrayList<SortResult>();
|
||||
|
||||
if(bubble){
|
||||
@@ -154,6 +155,10 @@ public class AlgorithmTester{
|
||||
QuickSorter qSorter = new QuickSorter(filename);
|
||||
results.add(qSorter.measuredSort());
|
||||
}
|
||||
if(quickTWP){
|
||||
QuickSorterThreeWay qTWPSorter = new QuickSorterThreeWay(filename);
|
||||
results.add(qTWPSorter.measuredSort());
|
||||
}
|
||||
if(merge){
|
||||
MergeSorter mSorter = new MergeSorter(filename);
|
||||
results.add(mSorter.measuredSort());
|
||||
|
||||
Reference in New Issue
Block a user