Exemplo n.º 1
0
        private static void Sort(ISort SortAlgorithm, ArrayTestBed origArrayTestBed, ArrayTestBed clonedArrayTestBed, string algorithmTitle)
        {
            //origArrayTestBed.DispayElements();

            GC.Collect();
            Metrics metric = new Metrics($"{algorithmTitle} Sort");

            var result = SortAlgorithm.Sort(origArrayTestBed);


            metric.Dispose();
            GC.Collect();

            metric = new Metrics($"Reverse {algorithmTitle} Sort");

            var result2 = SortAlgorithm.ReverseSort(clonedArrayTestBed);

            metric.Dispose();


            origArrayTestBed.arr   = result;
            clonedArrayTestBed.arr = result2;


            //origArrayTestBed.DispayElements();

            //clonedArrayTestBed.DispayElements();
            Console.WriteLine();

            Console.WriteLine("=======================================================================================================================================");
            Console.WriteLine();
        }