public void bubble () { boolean isSorted; int i; int j; int temp; j = list.length-1; isSorted = false; while ((isSorted == false) && (j > 0)) { if (Debug.on == true) displayDebug(); isSorted = true; for (i = 0; i < j; i++) { if (list[i] > list[i+1]) { temp = list[i]; list[i] = list[i+1]; list[i+1] = temp; isSorted = false; } } j--; } }