Skip to content

Instantly share code, notes, and snippets.

View mohamadgolshani's full-sized avatar
🚬

mohamadg mohamadgolshani

🚬
View GitHub Profile
@mohamadgolshani
mohamadgolshani / Trie.js
Created February 9, 2022 17:49 — forked from tpae/Trie.js
Trie.js - super simple JavaScript implementation
// Trie.js - super simple JS implementation
// https://en.wikipedia.org/wiki/Trie
// -----------------------------------------
// we start with the TrieNode
function TrieNode(key) {
// the "key" value will be the character in sequence
this.key = key;