Exemplo n.º 1
0
        public static void AnalysisArray_List(int seed, int kiek)
        {
            int n = duomskc;

            Console.WriteLine("Array RadixSort");
            Console.WriteLine("N         RunTime");
            for (int i = 0; i < kiek; i++)
            {
                MyDataArray myarr = new MyDataArray(n, seed);
                Stopwatch   timer = new Stopwatch();
                timer.Start();
                Program.RadixSortArray(myarr);
                timer.Stop();
                // myarr.Print(n);
                Console.WriteLine("{0,-10}{1}", n, timer.Elapsed);
                n = n * 2;
            }

            Console.WriteLine();
            n = duomskc;
            Console.WriteLine("List RadixSort");
            Console.WriteLine("N         RunTime");
            for (int i = 0; i < kiek; i++)
            {
                MyDataList mylist = new MyDataList(n, seed);
                Stopwatch  timer  = new Stopwatch();
                timer.Start();
                Program.RadixSortList(mylist);
                timer.Stop();
                //mylist.Print(n);
                Console.WriteLine("{0,-10}{1}", n, timer.Elapsed);
                n = n * 2;
            }
            Console.WriteLine();
        }
Exemplo n.º 2
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("---RadixSortedArray");
            RadixSortArray(myArray);
            myArray.Print(n);
            Console.WriteLine();
            MyDataList mylist = new MyDataList(n, seed);

            Console.WriteLine("---List---");
            mylist.Print(n);
            Console.WriteLine();
            Console.WriteLine("---RadixSortedList---");
            RadixSortList(mylist);
            mylist.Print(n);
            Console.WriteLine();
        }