Exemple #1
0
        public void Test3()
        {
            var arr = new int[] { 4, 2, 9, 5, 8, 16 };
            var ms  = new MergeSortV2();

            ms.MergeSort(arr);

            var copy = new int[arr.Length];

            Array.Copy(arr, copy, arr.Length);
            Array.Sort(copy);

            Assert.That(arr.SequenceEqual(copy), Is.True);
        }
Exemple #2
0
        public void Test1()
        {
            int[] arr = new int[] { 3, 1, 2 };

            int[] exp = new List <int>(arr).ToArray();
            Array.Sort(exp);

            var ms = new MergeSortV2();

            ms.MergeSort(arr);

            bool areEqual = arr.SequenceEqual(exp);

            Assert.That(areEqual, Is.True);
        }