Skip to content

Instantly share code, notes, and snippets.


João Pereira NSMyself

View GitHub Profile
NSMyself / graph.swift
Last active Feb 2, 2019
Graph (powered by adjacency lists) - IsTree
View graph.swift
import Foundation
struct Edge<T> where T: Hashable {
var vertex: Vertex<T>
var edges: [Edge<T>] = []
struct Vertex<T> where T: Hashable {
let id: Int
let data: T
You can’t perform that action at this time.