much implementation, ready for first test

This commit is contained in:
2020-05-30 18:46:10 -05:00
parent 741d29f148
commit c680ec7671
8 changed files with 159 additions and 11 deletions

View File

@@ -19,12 +19,14 @@ import java.time.Duration;
*/
public class SortResult {
private int[] sortedArray;
private String sortType;
private Integer [] sortedArray;
private String comparisonsUsed;
private String swapsUsed;
private Duration timeUsed;
public SortResult(int[] a, long c, long s, Duration t){
public SortResult(String st, Integer[] a, long c, long s, Duration t){
sortType = st;
sortedArray = a;
if(c==0){
comparisonsUsed = "None";
@@ -41,11 +43,32 @@ public class SortResult {
timeUsed = t;
}
public SortResult(int [] a, Duration t){
public SortResult(String st, Integer[] a, Duration t){
sortType = st;
sortedArray = a;
timeUsed = t;
comparisonsUsed = "Unknown";
swapsUsed = "Unknown";
}
public String getSortType(){
return sortType;
}
public Integer[] getSortedArray(){
return sortedArray;
}
public Duration getTimeUsed(){
return timeUsed;
}
public String getComparisonsUsed(){
return comparisonsUsed;
}
public String getSwapsUsed(){
return swapsUsed;
}
}