All Projects → apple → Swift Algorithms

apple / Swift Algorithms

Licence: apache-2.0
Commonly used sequence and collection algorithms for Swift

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Swift Algorithms

iterative
Functions for working with iterators in JavaScript and TypeScript
Stars: ✭ 16 (-99.59%)
Mutual labels:  iterator, itertools
Designpatterns
🔑Elements of Reusable Object-Oriented Software🔓is a software engineering book describing software design patterns. The book's authors are Erich Gamma, Richard Helm, Ralph Johnson and John Vlissides with a foreword by Grady Booch.
Stars: ✭ 134 (-96.59%)
Mutual labels:  iterator
Range V3
Range library for C++14/17/20, basis for C++20's std::ranges
Stars: ✭ 3,231 (-17.87%)
Mutual labels:  iterator
Resumablefunctions.jl
C# style generators a.k.a. semi-coroutines for Julia.
Stars: ✭ 82 (-97.92%)
Mutual labels:  iterator
Iterator
The Hoa\Iterator library.
Stars: ✭ 333 (-91.54%)
Mutual labels:  iterator
Easyiterator
🏃 Iterators made easy! Zero cost abstractions for designing and using C++ iterators.
Stars: ✭ 107 (-97.28%)
Mutual labels:  iterator
cron-schedule
A zero-dependency cron parser and scheduler for Node.js, Deno and the browser.
Stars: ✭ 28 (-99.29%)
Mutual labels:  iterator
Pydesignpattern
Design Pattern that described by Python, This is the source code for the book of Everybody Know Design Patterns.
Stars: ✭ 174 (-95.58%)
Mutual labels:  iterator
Rubico
[a]synchronous functional programming
Stars: ✭ 133 (-96.62%)
Mutual labels:  iterator
Linq In Rust
Language Integrated Query in Rust.
Stars: ✭ 48 (-98.78%)
Mutual labels:  iterator
Finder
The Finder component finds files and directories via an intuitive fluent interface.
Stars: ✭ 7,840 (+99.29%)
Mutual labels:  iterator
Tbox
🎁 A glib-like multi-platform c library
Stars: ✭ 3,800 (-3.41%)
Mutual labels:  iterator
Gods
GoDS (Go Data Structures). Containers (Sets, Lists, Stacks, Maps, Trees), Sets (HashSet, TreeSet, LinkedHashSet), Lists (ArrayList, SinglyLinkedList, DoublyLinkedList), Stacks (LinkedListStack, ArrayStack), Maps (HashMap, TreeMap, HashBidiMap, TreeBidiMap, LinkedHashMap), Trees (RedBlackTree, AVLTree, BTree, BinaryHeap), Comparators, Iterators, …
Stars: ✭ 10,883 (+176.64%)
Mutual labels:  iterator
Collection
A (memory) friendly, easy, lazy and modular collection class.
Stars: ✭ 331 (-91.59%)
Mutual labels:  iterator
Mir Algorithm
Dlang Core Library
Stars: ✭ 143 (-96.37%)
Mutual labels:  iterator
Kind Of
Get the native JavaScript type of a value, fast. Used by superstruct, micromatch and many others!
Stars: ✭ 268 (-93.19%)
Mutual labels:  iterator
Scandir
Better directory iterator and faster os.walk(), now in the Python 3.5 stdlib
Stars: ✭ 471 (-88.03%)
Mutual labels:  iterator
Imlazy
😴 Functional programming with lazy immutable iterables
Stars: ✭ 89 (-97.74%)
Mutual labels:  iterator
Php Pdo Mysql Class
A PHP MySQL PDO class similar to the the Python MySQLdb, which supports iterator and parameter binding when using "WHERE IN" statement.
Stars: ✭ 213 (-94.59%)
Mutual labels:  iterator
Rolling
Computationally efficient rolling window iterators for Python (including sum, min/max, median and more...)
Stars: ✭ 158 (-95.98%)
Mutual labels:  iterator

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].