Back to Swift Algorithms

Guides

Guides/README.md

1.2.16.3 KB
Original Source

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