Пример #1
0
 public void BenchInsertionSort()
 {
     /*
      *  19 - median 272 ns    GenerateRandomArray (5,75us)
      *  190 - 2,6 us
      *  1900 - 24 us
      *  19000 - 243 us
      * */
     InsertionSort.Act(array);
 }
Пример #2
0
        static void Main(string[] args)
        {
            var array = GenerateRandomArray(19);

            int[] array2 = new int[19];
            int[] array3 = new int[19];
            int[] array4 = new int[19];
            int[] array5 = new int[19];
            Array.Copy(array, array2, array.Length);
            Array.Copy(array, array3, array.Length);
            Array.Copy(array, array4, array.Length);
            Array.Copy(array, array5, array.Length);

            PrintArray(array);

            SelectionSort.Act(array);
            PrintArray(array);

            InsertionSort.Act(array2);
            PrintArray(array2);

            MergeSort.Act(array3);
            PrintArray(array3);

            QuickSort.Act(array4);
            PrintArray(array4);

            BubbleSort.Act(array5);
            PrintArray(array5);

            BenchmarkRunner.Run <BenchmarkAccomulator>();


            Console.WriteLine("End");
            Console.ReadLine();
        }