Exemple #1
0
        public static void Solve()
        {
            var parsedArray = GetArrayFromWeb(Link);
            var counter     = new InversionCounter();

            Console.WriteLine(counter.CountInversions(parsedArray));
        }
Exemple #2
0
        public void CountInversions()
        {
            var mergeSort = new MergeSort <double>();
            var sut       = new InversionCounter();

            //int[] testArray = { 4, 1, 2, 3 };
            int[] testArray = { 6, 5, 4, 3, 2, 1 };

            int splitInv = sut.CountInversions(testArray);

            Assert.That(splitInv, Is.EqualTo(15));
        }