bugfix
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package Sorting;
|
||||
|
||||
import java.util.Scanner;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.InputMismatchException;
|
||||
//import java.time.temporal.ChronoUnit;
|
||||
@@ -196,7 +197,7 @@ public class AlgorithmTester{
|
||||
int input;
|
||||
boolean ready=false;
|
||||
boolean print=false;
|
||||
String[] sortingAlgoNames = {"selection sort", "insertion sort"};
|
||||
String[] sortingAlgoNames = {"selection sort", "insertion sort", "quick sort"};
|
||||
boolean[] sortingAlgoChoices = new boolean[sortingAlgoNames.length];
|
||||
System.out.print("\nPlease enter file name: ");
|
||||
filename = sc.next();
|
||||
@@ -245,6 +246,7 @@ public class AlgorithmTester{
|
||||
}
|
||||
boolean selection = sortingAlgoChoices[0];
|
||||
boolean insertion = sortingAlgoChoices[1];
|
||||
boolean quick = sortingAlgoChoices[2];
|
||||
ArrayList<SortResult> results = new ArrayList<SortResult>();
|
||||
if(selection){
|
||||
WordSelectionSorter selSorter = new WordSelectionSorter(reader);
|
||||
@@ -254,6 +256,11 @@ public class AlgorithmTester{
|
||||
WordInsertionSorter inSorter = new WordInsertionSorter(reader);
|
||||
results.add(inSorter.measuredSort());
|
||||
}
|
||||
if(quick){
|
||||
//put wordquicksorter here
|
||||
Sorter qSorter = new WordQuickSorter(reader);
|
||||
results.add(qSorter.measuredSort());
|
||||
}
|
||||
for(SortResult e: results){
|
||||
if(e!=null){
|
||||
if(print){
|
||||
|
||||
Reference in New Issue
Block a user