Various Collections and Data Structures
import Generator
import Graph
import Pairdependencies: [
.package(url: "https://github.com/DavidSkrundz/Collections.git",
from: "2.0.0")
],
targets: [
.target(
name: "",
dependencies: [
"Generator", "Graph", "Pair"
]),
]Implements to Iterator but also allows reversing (previous() -> Element?)
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>]Like zip(_:_:) but returns a Sequence containing the cartesian product (all pairs) of the two sequences