コード例 #1
0
 public static bool QuickSortWithRandom(int[] numbers, int size)
 {
     numbers = ArrayGenerator.GenerateRandomArray(size);
     return(true);
 }
コード例 #2
0
        static void RunAnalysis(int size)
        {
            int[]     randomArray = ArrayGenerator.GenerateRandomArray(size);
            Stopwatch stopWatch   = new Stopwatch();

            #region BubbleSort_random
            //stopWatch.Start();
            //bool IndexofBubbleSort = SimpleSorting.bubble_sortWithRandomArray(randomArray);
            //stopWatch.Stop();
            //long TimeBubblesort = stopWatch.ElapsedMilliseconds;
            #endregion

            #region BubbleSort_V_shaped

            //stopWatch.Reset();

            //stopWatch.Start();
            //bool IndexofBubbleSortVShaped = SimpleSorting.bubble_sort_V_shape(randomArray,size);
            //stopWatch.Stop();
            //long TimeBubblesortVShaped= stopWatch.ElapsedMilliseconds;
            #endregion

            #region BubbleSort_A_shaped

            //stopWatch.Reset();

            //stopWatch.Start();
            //bool IndexofBubbleSortAShaped = SimpleSorting.bubble_sort_V_shape(randomArray, size);
            //stopWatch.Stop();
            //long TimeBubblesortAShaped = stopWatch.ElapsedMilliseconds;

            //Console.WriteLine(TimeBubblesortAShaped);

            #endregion

            #region BubbleSort_ascending

            //stopWatch.Reset();

            //stopWatch.Start();
            //bool IndexofBubbleSortAscending= SimpleSorting.bubble_sort_ascending(randomArray, size);
            //stopWatch.Stop();
            //long TimeBubblesortAscending = stopWatch.ElapsedMilliseconds;
            ////Console.WriteLine(TimeBubblesortAscending);

            #endregion

            #region BubbleSort_descending

            //stopWatch.Reset();

            //stopWatch.Start();
            //bool IndexofBubbleSortDescending = SimpleSorting.bubble_sort_descending(randomArray, size);
            //stopWatch.Stop();
            //long TimeBubblesortDescending = stopWatch.ElapsedMilliseconds;
            //Console.WriteLine(TimeBubblesortDescending);

            #endregion

            #region RandomQuickSort
            stopWatch.Reset();

            stopWatch.Start();
            //bool indexofQuickSort = AdvancedSorting.QuickSortWithRandom(randomArray,size);
            //stopWatch.Stop();
            //long TimeQuickSort = stopWatch.ElapsedMilliseconds;
            //Console.WriteLine(TimeQuickSort);

            #endregion

            #region QuickSort_V_shape
            //stopWatch.Reset();

            //stopWatch.Start();
            //bool indexofQuickSortVShape = AdvancedSorting.QuickSortVshape(randomArray, size);
            //stopWatch.Stop();
            //long TimeQuickSortVShape = stopWatch.ElapsedMilliseconds;
            //Console.WriteLine(TimeQuickSortVShape);


            #endregion

            #region QuickSort_A_shape
            //stopWatch.Reset();

            //stopWatch.Start();
            //bool indexofQuickSortAShape = AdvancedSorting.QuickSortVshape(randomArray, size);
            //stopWatch.Stop();
            //long TimeQuickSortAShape = stopWatch.ElapsedMilliseconds;
            //Console.WriteLine(TimeQuickSortVShape);


            #endregion

            #region QuickSort_ascending
            // stopWatch.Reset();

            //stopWatch.Start();
            //bool indexofQuickSortAscending = AdvancedSorting.QuickSortVshape(randomArray, size);
            //stopWatch.Stop();
            //long TimeQuickSortAscending = stopWatch.ElapsedMilliseconds;
            //Console.WriteLine(TimeQuickSortAscending);

            #endregion

            #region QuickSort_Descending
            //stopWatch.Reset();

            //stopWatch.Start();
            //bool indexofQuickSortDescending = AdvancedSorting.QuickSortVshape(randomArray, size);
            //stopWatch.Stop();
            //long TimeQuickSortDescending= stopWatch.ElapsedMilliseconds;
            //Console.WriteLine(TimeQuickSortDescending);

            #endregion

            CountingSorting.CountingSort(randomArray);
        }