mirror of
https://github.com/apple/swift-algorithms
synced 2026-11-24 04:17:48 +00:00
35 lines
962 B
Markdown
35 lines
962 B
Markdown
# Partitioning and Rotating
|
|
|
|
Partition a collection according to a unary predicate,
|
|
rotate a collection around a particular index,
|
|
or find the index where a collection is already partitioned.
|
|
|
|
## Topics
|
|
|
|
### Stable Partition
|
|
|
|
- ``Swift/MutableCollection/stablePartition(by:)``
|
|
- ``Swift/MutableCollection/stablePartition(subrange:by:)``
|
|
- ``Swift/Sequence/partitioned(by:)``
|
|
- ``Swift/Collection/partitioned(by:)``
|
|
|
|
### Partition of Subranges
|
|
|
|
- ``Swift/MutableCollection/partition(subrange:by:)-5vdh7``
|
|
- ``Swift/MutableCollection/partition(subrange:by:)-4gpqz``
|
|
|
|
### Finding a Partition Index
|
|
|
|
- ``Swift/Collection/partitioningIndex(where:)``
|
|
|
|
### Rotation
|
|
|
|
- ``Swift/MutableCollection/rotate(toStartAt:)-9fp48``
|
|
- ``Swift/MutableCollection/rotate(toStartAt:)-2r55j``
|
|
- ``Swift/MutableCollection/rotate(subrange:toStartAt:)-ov6a``
|
|
- ``Swift/MutableCollection/rotate(subrange:toStartAt:)-5teoq``
|
|
|
|
### Reversing
|
|
|
|
- ``Swift/MutableCollection/reverse(subrange:)``
|