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.

zip
swift-algorithms-main.zip 预估大小:71个文件
folder
swift-algorithms-main 文件夹
file
.gitignore 80B
file
Package.swift 1KB
file
README.md 5KB
file
CHANGELOG.md 6KB
folder
.github 文件夹
file
PULL_REQUEST_TEMPLATE.md 882B
folder
PULL_REQUEST_TEMPLATE 文件夹
file
NEW.md 1KB
folder
ISSUE_TEMPLATE 文件夹
file
FEATURE_REQUEST.md 505B
file
BUG_REPORT.md 1KB
file
config.yml 200B
folder
Sources 文件夹
folder
Algorithms 文件夹
file
Partition.swift 7KB
file
Indexed.swift 3KB
file
Permutations.swift 12KB
file
Chain.swift 10KB
file
Combinations.swift 10KB
file
Windows.swift 11KB
file
Suffix.swift 3KB
file
RandomSample.swift 8KB
file
Intersperse.swift 7KB
file
Rotate.swift 11KB
file
Trim.swift 1KB
file
Product.swift 15KB
file
Chunked.swift 17KB
file
Cycle.swift 3KB
file
MinMax.swift 14KB
file
Stride.swift 8KB
file
Unique.swift 3KB
file
LazySplit.swift 25KB
file
CONTRIBUTING.md 468B
file
CODE_OF_CONDUCT.md 3KB
file
.xcodesamplecode.plist 181B
file
LICENSE.txt 11KB
folder
Tests 文件夹
file
LinuxMain.swift 634B
folder
SwiftAlgorithmsTests 文件夹
file
MinMaxTests.swift 7KB
file
UniqueTests.swift 1KB
file
PermutationsTests.swift 6KB
file
CycleTests.swift 1KB
file
PartitionTests.swift 3KB
file
RandomSampleTests.swift 4KB
file
IndexedTests.swift 1KB
file
ProductTests.swift 2KB
file
StrideTests.swift 5KB
file
CombinationsTests.swift 5KB
file
RotateTests.swift 3KB
file
ChunkedTests.swift 5KB
file
SuffixTests.swift 2KB
file
ChainTests.swift 2KB
file
WindowsTests.swift 3KB
file
IntersperseTests.swift 2KB
file
LazySplitTests.swift 31KB
file
TrimTests.swift 2KB
file
TestUtilities.swift 9KB
folder
Guides 文件夹
file
Chunked.md 4KB
file
Suffix.md 1KB
file
Intersperse.md 2KB
folder
Resources 文件夹
folder
SortedPrefix 文件夹
file
ManyElements.png 77KB
file
FewElements.png 74KB
file
Product.md 2KB
file
Indexed.md 959B
file
Trim.md 5KB
file
Rotate.md 2KB
file
RandomSampling.md 6KB
file
Chain.md 2KB
file
Windows.md 2KB
file
Partition.md 4KB
file
Unique.md 2KB
file
MinMax.md 2KB
file
Cycle.md 2KB
file
Permutations.md 3KB
file
Combinations.md 3KB
file
Stride.md 2KB
file
LazySplit.md 3KB
...
zip 文件大小:256.14KB