MCPcopy Index your code
hub / github.com/TheAlgorithms/Go / Size

Method Size

structure/trie/trie.go:64–73  ·  view source on GitHub ↗

Size returns the number of words in the Trie

()

Source from the content-addressed store, hash-verified

62
63// Size returns the number of words in the Trie
64func (n *Node) Size() int {
65 r := 0
66 for _, c := range n.children {
67 r += c.Size()
68 }
69 if n.isLeaf {
70 r++
71 }
72 return r
73}
74
75// remove lazily a word from the Trie node, no node is actually removed.
76func (n *Node) remove(s string) {

Callers 3

ExampleNodeFunction · 0.95
TestTrieRemoveFunction · 0.95
verifySizeCapaMethod · 0.95

Calls

no outgoing calls

Tested by 3

ExampleNodeFunction · 0.76
TestTrieRemoveFunction · 0.76
verifySizeCapaMethod · 0.76