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

            Console.WriteLine(counter.CountInversions(parsedArray));
        }
예제 #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));
        }