示例#1
0
        static void ShowResult(SortResult sortResult)
        {
            Console.Write("Sorted : ");
            ShowArray(sortResult.Sorted);
            Console.WriteLine();

            Console.WriteLine($"Sorted result : time: {sortResult.Time:f2} ms");
        }
示例#2
0
        private static bool IsSorted(SortResult result)
        {
            for (int i = 1; i < result.SortedArray.Length; i++)
            {
                if (result.SortedArray[i].CompareTo(result.SortedArray[i - 1]) < 0)
                {
                    return(false);
                }
            }

            return(true);
        }