Re-order the given range
of elements in self
and return
a pivot index p.
Postcondition: For all i in range.startIndex..<
p, and j
in p..<range.endIndex
, less(self[
i],
self[
j]) && !less(self[
j], self[
p])
.
Only returns range.endIndex
when self
is empty.
Requires: The less-than operator (func <
) defined in
the Comparable
conformance is a
strict weak ordering
over the elements in self
.
Declaration
mutating func partition(range: Range<Int>) -> Int
Declared In
MutableCollectionType