namespace ALGA { public class Bubblesort { public static void bubblesort(ISortList list) { for (int i = 0; i < list.Count - 1; i++) { bool swapped = false; for (int j = 0; j < list.Count - i - 1; j++) { if (list.compare(j, j + 1) <= 0) continue; list.swap(j, j + 1); swapped = true; } if (!swapped) break; } } } }