
public class BubbleSort extends SortingAlgorithm implements Runnable{

    public BubbleSort(Integer[] toBeSorted, VisualizerFrame frame) {
        super(toBeSorted, frame);
    }

    public void sort() { 
         for(int i = 0; i < getSize(); i++){  
                 for(int j = 0; j < (getSize()-1); j++){  
                          if(compare(i, j) == 1){    
                          swap(i, j);                         
       }
   
    }
  
    }
   }
  }