示例#1
0
        static bool TestFive()
        {
            var array = new int[0];

            QuickSort.Sort(array);

            return(QuickSort.IsSorted(array));
        }
示例#2
0
        static bool TestOne()
        {
            var array = new[] { 616, 20, 0 };

            QuickSort.Sort(array);

            return(QuickSort.IsSorted(array));
        }
示例#3
0
        static bool EmptyMassiveTest()
        {
            var array = new int[0];

            QuickSort.Sort(array);

            return(QuickSort.IsSorted(array));
        }
示例#4
0
        static bool ThreeElementsTest()
        {
            var array = new[] { 10, 5, -10 };

            QuickSort.Sort(array);

            return(QuickSort.IsSorted(array));
        }
示例#5
0
        static void Main(string[] args)
        {
            int[]     array  = new int[] { 2, 14, 11, 16, 82, 4, 34, 51, 1, 4 };
            QuickSort sorter = new QuickSort();

            sorter.Sort(array, 0, array.Length - 1);
            Console.WriteLine(string.Join(", ", array));
        }
示例#6
0
        static bool OneHundredElementsTest()
        {
            var array = new int[100];

            for (var i = 0; i < array.Length; i++)
            {
                array[i] = 12;
            }
            QuickSort.Sort(array);

            return(QuickSort.IsSorted(array));
        }
示例#7
0
        static bool TestThree()
        {
            var rand  = new Random();
            var array = new int[1000];

            for (var i = 0; i < array.Length; i++)
            {
                array[i] = rand.Next();
            }
            QuickSort.Sort(array);

            return(QuickSort.IsSorted(array));
        }
示例#8
0
        static bool TestTwo()
        {
            var array = new int[100];

            for (var i = 0; i < array.Length; i++)
            {
                array[i] = 32;
            }

            QuickSort.Sort(array);

            return(QuickSort.IsSorted(array));
        }