NewNode creates a new Trie node with initialized children map.
()
| 12 | // NewNode creates a new Trie node with initialized |
| 13 | // children map. |
| 14 | func NewNode() *Node { |
| 15 | n := &Node{} |
| 16 | n.children = make(map[rune]*Node) |
| 17 | n.isLeaf = false |
| 18 | return n |
| 19 | } |
| 20 | |
| 21 | // insert a single word at a Trie node. |
| 22 | func (n *Node) insert(s string) { |
no outgoing calls