Skip to content

Instantly share code, notes, and snippets.

View gregwym's full-sized avatar
😁
Whow, status!

Greg Wang gregwym

😁
Whow, status!
View GitHub Profile
@gregwym
gregwym / Trie.ts
Last active May 3, 2021 23:12 — forked from tpae/Trie.js
Trie.ts - super simple JavaScript implementation
// Trie.ts - super simple JS implementation
// https://en.wikipedia.org/wiki/Trie
// -----------------------------------------
// we start with the TrieNode
class TrieNode<V> {
// we keep a reference to parent
public parent = null;