Data Structures
    Overview
    Number
    String
    Array
    Linked List
    Stack
    Hash
    Tree
    Trie
    Advanced Data Structure
    Probabilistic Data Structures
    Big O

Trie

Updated: 2022-03-29
Trie trie = new Trie();
for (String word : dict) {
    trie.add(word);
}

class Trie {
  TrieNode root;

  public void add(String word) {
    root.add(word);
  }
}

class TrieNode {
  char val;
  Set<TrieNode> children;

  TrieNode(char val) {
    this.val = val;
    this.children = new ArrayList<TrieNode>();
  }

  public void add(String word) {
    char v = word.charAt(0);
    if (children.contains(v)) {

    }
  }
}