Files
..
2025-01-14 12:42:37 -06:00
2024-02-07 00:18:57 -06:00
2021-10-20 22:21:39 +02:00
2023-11-14 21:50:39 -06:00
2024-04-12 16:09:42 +08:00
2023-11-14 13:00:34 -06:00

Guides

These guides describe the design and intention behind the APIs included in the Algorithms library. For further reading, see the announcement on swift.org and the official documentation.

Contents

Combinations / permutations

Mutating algorithms

Combining collections

  • chain(_:_:): Concatenates two collections with the same element type.
  • cycled(), cycled(times:): Repeats the elements of a collection forever or a set number of times.
  • joined(by:): Concatenate sequences of sequences, using an element or sequence as a separator, or using a closure to generate each separator.
  • product(_:_:): Iterates over all the pairs of two collections; equivalent to nested for-in loops.

Subsetting operations

Partial sorting

Other useful operations