formatting output
This commit is contained in:
@@ -166,7 +166,7 @@ public class AlgorithmTester{
|
|||||||
System.out.print(i+" ");
|
System.out.print(i+" ");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
System.out.println("\n"+e.getSortType()+" sort took:");
|
System.out.println("\n"+e.getSortType()+" sort of "+e.getSortCount()+" numbers took:");
|
||||||
System.out.println(e.getComparisonsUsed()+" comparisons");
|
System.out.println(e.getComparisonsUsed()+" comparisons");
|
||||||
System.out.println(e.getWritesUsed()+" write operations");
|
System.out.println(e.getWritesUsed()+" write operations");
|
||||||
System.out.println(e.getTimeUsed()+" milliseconds");
|
System.out.println(e.getTimeUsed()+" milliseconds");
|
||||||
|
|||||||
@@ -70,4 +70,9 @@ public class SortResult {
|
|||||||
return writesUsed;
|
return writesUsed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getSortCount(){
|
||||||
|
NumberFormat nf = NumberFormat.getInstance(Locale.US);
|
||||||
|
return nf.format(sortedArray.length);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user