rename to distinguish btw number and word sorters

This commit is contained in:
2020-06-17 16:50:25 -05:00
parent fdca76f02a
commit 0daafbe767
9 changed files with 25 additions and 25 deletions

View File

@@ -0,0 +1,24 @@
package Sorting;
public class NumberBubbleSorter extends NumberSorter{
//a class to sort arrays of numbers using bubble sort
public NumberBubbleSorter(RandomNumberFileReader reader){
super("bubble sort", reader);
}
void sort(){
boolean usedSwap;
do{
usedSwap=false;
for(int i=0;i<numbers.length-1;i++){
if(compare(numbers[i],numbers[i+1])>0){
swap(i,i+1);
usedSwap=true;
}
}
}while(usedSwap);
}
}