[Toggle Comments]
package trie // file: ./trie/node.go type node struct { links map[rune]*node size int end bool } func (n *node) Put(r rune, nd *node) { n.links[r] = nd n.size++ } func (n *node) Get(r rune) *node { return n.links[r] } func (n *node) Contains(r rune) bool { return n.Get(r) != nil } func (n *node) Count() int { return n.size } func (n *node) MarkEnd() { n.end = true } func NewNode() *node { return &node{ links: make(map[rune]*node), size: 0, end: false, } } /* * \ * \\, * \\\,^,.,,. Zero to Hero * ,;7~((\))`;;,, <zerotohero.dev> * ,(@') ;)`))\;;', stay up to date, be curious: learn * ) . ),(( ))\;, * /;`,,/7),)) )) )\,, * (& )` (,((,((;( ))\, */