ktrie/ktrie.go
func (n *KNode) Add(rs []rune) {
	cur := n

	for k, v := range rs {
		link := cur.linkByVal(v)

		if link == nil {
			link = NewKNode(v)
			cur.links = append(cur.links, link)
		}

		if k == len(rs)-1 {
			link.end = true
		}

		cur = link
	}
}
func (n *KNode) Add(rs []rune) {
	cur := n

	for k, v := range rs {
		link := cur.linkByVal(v)

		if link == nil {
			link = NewKNode(v)
			cur.links = append(cur.links, link)
		}

		if k == len(rs)-1 {
			link.end = true
		}

		cur = link
	}
}
// Add ...