using SlowSort; /* * Slow Sorting algorithm for CSC 3102 Portfolio * Bubble Sort */ namespace SlowSort { //Bubble Sort class SlowSort_3102 { public static void Sort(int[] list) { for(int i = list.Length; i > 0; i--) { for (int j = 0; j < i; j++) { if (j + 1 < list.Length) { if (list[j + 1] < list[j]) { int temp = list[j + 1]; list[j + 1] = list[j]; list[j] = temp; } } } } } } } /* namespace MyProgram { class Program { static void Main(string[] args) { int[] array1 = new int[100]; for (int i = 0; i < array1.Length; i ++) { array1[i] = new Random().Next(0, 1000); } SlowSort_3102.Sort(array1); Console.Write("[ "); for (int i = 0; i < array1.Length; i++) { Console.Write(array1[i] + " "); } Console.WriteLine("]"); } } } */