目录
目录README.md

Collections

Various Collections and Data Structures

Importing

import Generator
import Graph
import Pair
dependencies: [
    .package(url: "https://github.com/DavidSkrundz/Collections.git",
             from: "2.0.0")
],
targets: [
    .target(
        name: "",
        dependencies: [
            "Generator", "Graph", "Pair"
        ]),
]

Generator

Implements to Iterator but also allows reversing (previous() -> Element?)

Graph

A basic graph class that implements:

func neighbours(of vertex: Vertex<T>) -> [Vertex<T>]
func reachable(from vertex: Vertex<T>) -> [Vertex<T>]
reachable(from vertex: Vertex<T>, where canReach: (_ distance: Int, _ edge: U?) -> Bool) -> [Vertex<T>]

pair(_:_:)

Like zip(_:_:) but returns a Sequence containing the cartesian product (all pairs) of the two sequences

关于
85.0 KB
邀请码
    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

©Copyright 2023 CCF 开源发展委员会
Powered by Trustie& IntelliDE 京ICP备13000930号