GithubHelp home page GithubHelp logo

isabella232 / swift-algorithms Goto Github PK

View Code? Open in Web Editor NEW

This project forked from apple/swift-algorithms

0.0 0.0 0.0 829 KB

Commonly used sequence and collection algorithms for Swift

License: Apache License 2.0

Swift 100.00%

swift-algorithms's Introduction

Swift Algorithms

Swift Algorithms is an open-source package of sequence and collection algorithms, along with their related types.

Read more about the package, and the intent behind it, in the announcement on swift.org.

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

Adding Swift Algorithms as a Dependency

To use the Algorithms library in a SwiftPM project, add the following line to the dependencies in your Package.swift file:

.package(url: "https://github.com/apple/swift-algorithms", from: "1.0.0"),

Include "Algorithms" as a dependency for your executable target:

.target(name: "<target>", dependencies: [
    .product(name: "Algorithms", package: "swift-algorithms"),
]),

Finally, add import Algorithms to your source code.

Source Stability

The Swift Algorithms package is source stable; version numbers follow Semantic Versioning. Source breaking changes to public API can only land in a new major version.

The public API of version 1.0 of the swift-algorithms package consists of non-underscored declarations that are marked public in the Algorithms module. Interfaces that aren't part of the public API may continue to change in any release, including patch releases.

Future minor versions of the package may introduce changes to these rules as needed.

We'd like this package to quickly embrace Swift language and toolchain improvements that are relevant to its mandate. Accordingly, from time to time, we expect that new versions of this package will require clients to upgrade to a more recent Swift toolchain release. Requiring a new Swift release will only require a minor version bump.

swift-algorithms's People

Contributors

natecook1000 avatar lucianopalmeida avatar ollieatkinson avatar mdznr avatar timvermeulen avatar michiboo avatar danielctull avatar kylemacomber avatar lemonspike avatar karwa avatar stephentyrone avatar austinconlon avatar hashemi avatar nordicio avatar bjhomer avatar benrimmington avatar qata avatar ctmacuser avatar dhruvshah8 avatar egorzhdan avatar fedeci avatar iainsmith avatar iankeen avatar sidepelican avatar schlagelk avatar markuswntr avatar pmtao avatar mpangburn avatar ole avatar rakaramos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.