Eliminated swap counting, got bubble, selection, and insertion sort working
This commit is contained in:
@@ -14,7 +14,7 @@ public class BubbleSorter extends Sorter{
|
||||
usedSwap=false;
|
||||
for(int i=0;i<numbers.length-1;i++){
|
||||
if(compare(numbers[i],numbers[i+1])>0){
|
||||
swap(numbers[i],numbers[i+1]);
|
||||
swap(i,i+1);
|
||||
usedSwap=true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user