public static void Test_OP(int seed)
        {
            Console.WriteLine("---------------------------------------------");

            Console.WriteLine("Test OP");

            Stopwatch sw = new Stopwatch();

            sw.Start();
            MyDataArray myarray = new MyDataArray(n, seed);

            sw.Stop();

            Console.WriteLine("Size of {0} count was initialized in => {1}", n, sw.Elapsed);

            Console.WriteLine("\nHeapsort started (timer on) \n");

            sw.Start();

            myarray.Print(n);
            Heapsort_OP.HeapSort(myarray, n);

            myarray.Print(n);

            sw.Stop();

            Console.WriteLine("Test OP success ");
            Console.WriteLine("Size of {0} count array was sorted in => {1}", n, sw.Elapsed);
            Console.WriteLine("---------------------------------------------");
        }
        public static void Test_Array_List(int seed)
        {
            int         n       = 10;
            MyDataArray myarray = new MyDataArray(n, seed);

            Console.WriteLine("\n ARRAY \n");
            myarray.Print(n);
            HeapSort(myarray);
            myarray.Print(n);

            MyDataList mylist = new MyDataList(n, seed);

            Console.WriteLine("\n LIST \n");
            mylist.Print(n);
            HeapSort(mylist);
            mylist.Print(n);

            Test_Performance(seed);
        }
Beispiel #3
0
        public static void TestArray_List(int seed)
        {
            int         n       = 12;
            MyDataArray myArray = new MyDataArray(n, seed);

            Console.WriteLine("---Array---");
            myArray.Print(n);
            Console.WriteLine();
            Console.WriteLine("---HeapSortedArray---");
            HeapSortArray.HeapSortas(myArray);
            myArray.Print(n);
            Console.WriteLine();
            MyDataList myList = new MyDataList(n, seed);

            Console.WriteLine("---List---");
            myList.Print(n);
            Console.WriteLine();
            Console.WriteLine("---HeapSortedList---");
            HeapSortList.HeapSortas(myList);
            myList.Print(n);
            Console.WriteLine();
        }