public override async Task ComparisonTestAsync() { var data = await GetDuplicateDataAsync(); ShellSortOeisA003462.Sort(data, (x, y) => x.CompareTo(y)); CollectionAssert.AreEqual(data, DataAscendingOrdered); }
public override async Task AscendingTestAsync() { var data = await GetDuplicateDataAsync(); ShellSortOeisA003462.Sort(data); CollectionAssert.AreEqual(data, DataAscendingOrdered); }
static void Main(string[] args) { var rand = new Random(); var originalData = new int[DataLength]; for (var i = 0; i < originalData.Length; originalData[i++] = rand.Next()) { ; } var sortedData = originalData.OrderBy(q => q).ToArray(); for (var i = 0; i < TestLoop; ++i) { SortTest((data) => Array.Sort(data), originalData, sortedData); SortTest((data) => ExchangeSort.Sort(data), originalData, sortedData); SortTest((data) => InsertionSort.Sort(data), originalData, sortedData); SortTest((data) => ShellSort.Sort(data), originalData, sortedData); SortTest((data) => ShellSortOeisA003462.Sort(data), originalData, sortedData); SortTest((data) => ShellSortParallel.Sort(data), originalData, sortedData); SortTest((data) => ShellSortOeisA003462Parallel.Sort(data), originalData, sortedData); Console.WriteLine(); } }