MCPcopy Create free account
hub / github.com/TheAlgorithms/Go / CreateChild

Method CreateChild

project_euler/problem_18/leaf.go:31–40  ·  view source on GitHub ↗
(value NodeValue, id int)

Source from the content-addressed store, hash-verified

29}
30
31func (n *Leaf) CreateChild(value NodeValue, id int) Node {
32 // Leafs only have leaf children
33 return &Leaf{
34 ID: id,
35 NodeValue: value,
36 Parent: n,
37 NodeLeft: nil,
38 NodeRight: nil,
39 }
40}
41
42func (n *Leaf) GetID() int {
43 return n.ID

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected