Swift Algorithms Enhancing Collections and Sequences with Powerful Tools
Swift Algorithms is an open-source package designed to enhance sequence and collection algorithms in Swift. Here’s a breakdown of its primary functionalities:
- Combinations/Permutations: Generate combinations of elements of a specific size within a collection, or arrange them in specific orders.
- Mutating Algorithms: Perform in-place element rotations, making it easy to shift or rearrange data within collections.
- Partitioning: Divide a collection, maintaining relative order between prefix and suffix elements.
- Merging Collections: Seamlessly concatenate two collections of the same element type.
- Nested Pair Iteration: Traverse all pairs in two collections, equivalent to a nested
for-in
loop. - Repeated Elements: Iterate over a collection's elements indefinitely or for a fixed count.
- Subset Operations: Randomly select a specified number of elements from a collection or maintain their relative order during selection.
- Suffix Predicate Filtering: Return suffix elements that satisfy a given predicate.
- Unique Elements: Retrieve unique elements while maintaining the original order.
- Partial Sorting: Extract a subset of minimum or maximum elements sorted by a predicate.
Other utilities include eager and lazy operations based on binary predicates, projections, or chunking collections by specified counts.
swift-algorithms-main.zip
预估大小:71个文件
swift-algorithms-main
文件夹
.gitignore
80B
Package.swift
1KB
README.md
5KB
CHANGELOG.md
6KB
.github
文件夹
PULL_REQUEST_TEMPLATE.md
882B
PULL_REQUEST_TEMPLATE
文件夹
NEW.md
1KB
ISSUE_TEMPLATE
文件夹
...
256.14KB
文件大小:
评论区