// insert insert a word to tree.
insert insert a word to tree.
// insert insert a word to tree .
func (n *Node) insert(word string) {
	runes := []rune(word)
	curNode := n
	for _, r := range runes {
		if nextNode, ok := curNode.children[r]; ok {
			curNode = nextNode
		} else {
			curNode.children[r] = &Node{
				key:      string(r),
				children: make(map[rune]*Node),
			}
			curNode = curNode.children[r]
		}
	}
}
func ( n * Node ) insert ( word string ) { runes := [ ] rune ( word ) curNode := n for _ , r := range runes { if nextNode , ok := curNode . children [ r ] ; ok { curNode = nextNode } else { curNode . children [ r ] = & Node { key : string ( r ) , children : make ( map [ rune ] * Node ) , } curNode = curNode . children [ r ] } } }
insert insert a word to tree.
insert insert a word to tree .