You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implemented BuiltInSortingAlgorithmType to enumerate the sorting algorithms built into the library, including access to each algorithm's erased metatype.
Implemented minimum, maximum, and average number-of-comparisons calculations for all sorting algorithms.
Implemented isFinished property on sorting algorithms.
Made Element the primary associated type of SortingAlgorithm.
Changed
Made the number-of-comparisons calculations return Double instead of Int.
Made Comparison.callAsFunction() answer ties with the left side, which preserves the stability of stable sorting algorithms.
Fixed
Fixed the average number-of-comparisons calculations for InsertionSort and MergeSort, and the minimum for Quicksort, to be exact.
Fixed a crash when sorting an empty input with Quicksort.
Fixed a crash when peeking at an element in MergeSort right before the algorithm is finished.
Fixed answer(_:) and peekAtElement(for:) to have no effect when the algorithm is not at a point of comparison.