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

Method Find

structure/trie/trie.go:43–52  ·  view source on GitHub ↗

Find words at a Trie node.

(s string)

Source from the content-addressed store, hash-verified

41
42// Find words at a Trie node.
43func (n *Node) Find(s string) bool {
44 next, ok := n, false
45 for _, c := range s {
46 next, ok = next.children[c]
47 if !ok {
48 return false
49 }
50 }
51 return next.isLeaf
52}
53
54// Capacity returns the number of nodes in the Trie
55func (n *Node) Capacity() int {

Callers 4

ExampleNodeFunction · 0.95
verifyMethod · 0.95

Calls

no outgoing calls

Tested by 4

ExampleNodeFunction · 0.76
verifyMethod · 0.76