Find words at a Trie node.
(s string)
| 41 | |
| 42 | // Find words at a Trie node. |
| 43 | func (n *Node) Find(s string) bool { |
| 44 | next, ok := n, false |
| 45 | for _, c := range s { |
| 46 | next, ok = next.children[c] |
| 47 | if !ok { |
| 48 | return false |
| 49 | } |
| 50 | } |
| 51 | return next.isLeaf |
| 52 | } |
| 53 | |
| 54 | // Capacity returns the number of nodes in the Trie |
| 55 | func (n *Node) Capacity() int { |
no outgoing calls