public static final void bubbleSortArray(Comparable[] aArr){
  boolean bChanged=true;
  Comparable a, b;
  while (bChanged) {
    bChanged=false;
    for (int iCnt=0; iCnt < aArr.length - 1; iCnt++) {
      a=aArr[iCnt];
      b=aArr[iCnt + 1];
      if (a.compareTo(b) > 0) {
        aArr[iCnt]=b;
        aArr[iCnt + 1]=a;
        bChanged=true;
      }
    }
  }
}

public static final void bubbleSortArray ( Comparable [ ] aArr ) { boolean bChanged = true ; Comparable a , b ; while ( bChanged ) { bChanged = false ; for ( int iCnt = 0 ; iCnt < aArr . length - 1 ; iCnt ++ ) { a = aArr [ iCnt ] ; b = aArr [ iCnt + 1 ] ; if ( a . compareTo ( b ) > 0 ) { aArr [ iCnt ] = b ; aArr [ iCnt + 1 ] = a ; bChanged = true ; } } } }
bubble - sorts an array of comparable items .
