Capacity returns the number of nodes in the Trie
()
| 53 | |
| 54 | // Capacity returns the number of nodes in the Trie |
| 55 | func (n *Node) Capacity() int { |
| 56 | r := 0 |
| 57 | for _, c := range n.children { |
| 58 | r += c.Capacity() |
| 59 | } |
| 60 | return 1 + r |
| 61 | } |
| 62 | |
| 63 | // Size returns the number of words in the Trie |
| 64 | func (n *Node) Size() int { |
no outgoing calls