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

Function NewNode

structure/trie/trie.go:14–19  ·  view source on GitHub ↗

NewNode creates a new Trie node with initialized children map.

()

Source from the content-addressed store, hash-verified

12// NewNode creates a new Trie node with initialized
13// children map.
14func NewNode() *Node {
15 n := &Node{}
16 n.children = make(map[rune]*Node)
17 n.isLeaf = false
18 return n
19}
20
21// insert a single word at a Trie node.
22func (n *Node) insert(s string) {

Callers 10

BenchmarkTrie_InsertFunction · 0.70
ExampleNodeFunction · 0.70
insertMethod · 0.70
TestTrieInsertFunction · 0.70
TestTrieRemoveFunction · 0.70

Calls

no outgoing calls

Tested by 9

BenchmarkTrie_InsertFunction · 0.56
ExampleNodeFunction · 0.56
TestTrieInsertFunction · 0.56
TestTrieRemoveFunction · 0.56