private static void SingleThreaded(string[] args) { var inputFile = args[0]; var outputFile = args[1]; var array = ReaderWriter.Read(inputFile); QuickSort.Sort(array, 0, array.Count - 1); ReaderWriter.Write(outputFile, array); }
private static void SingleThreadedTest() { var array = new List <int> { 0, -6, 3, 23, 1, 4 }; QuickSort.Sort(array, 0, array.Count - 1); array.ForEach(el => Console.WriteLine(el)); Console.ReadKey(); }
private static bool Verify(IList <int> result, string inputFile) { QuickSort.PivotType = PivotType.Middle; var array = ReaderWriter.Read(inputFile); QuickSort.Sort(array, 0, array.Count - 1); QuickSort.PivotType = PivotType.Middle; var flag = true; for (int index = 0; index < result.Count; index++) { //Console.WriteLine($"Index {index}: {result[index]} ({array[index]})"); if (result[index] != array[index]) { flag = false; } } return(flag); }