package Sorting;

public class BubbleSorter extends Sorter{
    //a class to sort arrays of numbers using bubble sort

    public BubbleSorter(String filename){
        super("bubble", filename);
    }

    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);
    }

}