Skip to content

Instantly share code, notes, and snippets.

View sravanth-space's full-sized avatar
🎯
Focusing

Sravanth sravanth-space

🎯
Focusing
View GitHub Profile
@sravanth-space
sravanth-space / Trie.js
Last active April 25, 2023 19:17
Templates
class Node {
constructor(value) {
this.value = value;
this.children = new Map();
}
insert(s, idx) {
// idx: index of the current character in s
if (idx !== s.length) {
if (this.children.has(s.charAt(idx))) {