Beispiel #1
0
        public static void Main(string[] args)
        {
            if (args.Length == 2) {
                QuickSort<int> qs = new QuickSort<int> ();
                int length = Convert.ToInt32 (args [1]);
                int[] unsorted = new int[length];

                TextReader file = new StreamReader (args [0]);

                for (int i = 0; i < length; i++)
                    unsorted [i] = Convert.ToInt32 (file.ReadLine ());

                Console.WriteLine (string.Join (",", qs.quicksort (unsorted)));
            } else {
                Console.WriteLine ("Usage: ./program [list file] [list length]");
            }
        }
Beispiel #2
0
		static public void Main (string[] args)
		{
			if (args.Length == 2) {
				QuickSort<int> qs = new QuickSort<int> ();
				int length = Convert.ToInt32 (args [1]);
				int[] unsorted = new int[length];

				TextReader file = new StreamReader (args [0]);

				for (int i = 0; i < length; i++)
					unsorted [i] = Convert.ToInt32 (file.ReadLine ());

				Console.WriteLine (string.Join (",", qs.quicksort (unsorted)));
			} else {
				Console.WriteLine ("Usage: ./program [list file] [list length]");
			}
		}
Beispiel #3
0
 public void SetUp()
 {
     qs = new QuickSort<int> ();
 }
Beispiel #4
0
 public void SetUp()
 {
     qs = new QuickSort <int> ();
 }