added code to count write operations used

This commit is contained in:
2020-06-02 13:31:55 -05:00
parent 2e8fa28a5a
commit 9597c56c5d
5 changed files with 15 additions and 5 deletions

View File

@@ -16,9 +16,11 @@ public class InsertionSorter extends Sorter{
int j=i-1;
while(j>=0 && compare(numbers[j],insertionValue)>0){
numbers[j+1]=numbers[j];
writesUsed++;
j--;
}
numbers[j+1]=insertionValue;
writesUsed++;
}
}