MCPcopy Create free account
hub / github.com/arnauddri/algorithms / NewTree

Function NewTree

data-structures/binary-tree/bst.go:31–36  ·  view source on GitHub ↗
(n *Node)

Source from the content-addressed store, hash-verified

29}
30
31func NewTree(n *Node) *Tree {
32 if n == nil {
33 return &Tree{}
34 }
35 return &Tree{Head: n, Size: 1}
36}
37
38func (t *Tree) Insert(i int) {
39 n := &Node{Value: i}

Callers 1

TestTreeFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestTreeFunction · 0.68