Protocols
The following protocols are available globally.
-
A sorting algorithm, implemented statefully.
The algorithm is responsible for sorting
input
intooutput
given the answers to the comparisons returned fromcallAsFunction()
.The elements that are sorted do not need to conform to
See moreComparable
because the evaluation of the comparison is left to the caller.Declaration
Swift
public protocol SortingAlgorithm : Identifiable