// search search a word from a tree.
search search a word from a tree.
// search search a word from a tree .
func (n *Node) search(word string) bool {
	if len(n.key) == 0 && len(n.children) == 0 {
		return false
	}
	runes := []rune(word)
	curNode := n
	for _, r := range runes {
		if nextNode, ok := curNode.children[r]; ok {
			curNode = nextNode
		} else {
			return false
		}
	}
	return true
}
func ( n * Node ) search ( word string ) bool { if len ( n . key ) == 0 && len ( n . children ) == 0 { return false } runes := [ ] rune ( word ) curNode := n for _ , r := range runes { if nextNode , ok := curNode . children [ r ] ; ok { curNode = nextNode } else { return false } } return true }
search search a word from a tree.
search search a word from a tree .