示例#1
0
 static void Main(string[] args)
 {
     int[] arr = { 12, 42, 1, 11, 30 };
     BubbleSorter.DoSort(arr);
     for (int i = 0; i < arr.Length; i++)
     {
         Console.Write(arr[i] + " ");
     }
     Console.Read();
 }
示例#2
0
        static void Main(string[] args)
        {
            int[]        array        = { 4, 8, 2, 5, 8 };
            BubbleSorter bubbleSorter = new BubbleSorter(array);

            Console.WriteLine("source array");
            PrintArray(array);

            Console.WriteLine("Asc array");
            PrintArray(bubbleSorter.GetSortedArray(SortingOrder.Ascenging));

            Console.WriteLine("Desc array");
            PrintArray(bubbleSorter.GetSortedArray(SortingOrder.Descending));

            Console.ReadLine();
        }
 public void SetUp()
 {
     sorter = new BubbleSorter();
 }