コード例 #1
0
        static void Main(string[] args)
        {
            var quicksort = new Quicksort();

            var array = new[] { 3, 0,1, 6, -1, 0,1,2 };

            var sorted = quicksort.Sort(array);
        }
コード例 #2
0
 static void Main(string[] args)
 {
     int dataSetSize = 10000;
     List<int> data = Utilities.GenerateIntDataSet(dataSetSize);
     //            Console.WriteLine("The unsorted dataset is:\n{0}", Utilities.PrintList(data));
     //            Console.ReadKey();
     var sw = new Stopwatch();
     sw.Start();
     var qs = new Quicksort();
     qs.ProcessQuicksort(data, 0, data.Count-1);
     sw.Stop();
     Console.WriteLine("Quicksort took {0} milliseconds to process a dataset of {1} items.", sw.ElapsedMilliseconds.ToString(), dataSetSize);
     Console.ReadKey();
     //            Console.WriteLine("The sorted dataset is:\n{0}", Utilities.PrintList(data));
     //            Console.ReadKey();
 }