Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
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
31
func
NewTree(n *Node) *Tree {
32
if
n == nil {
33
return
&Tree{}
34
}
35
return
&Tree{Head: n, Size: 1}
36
}
37
38
func
(t *Tree) Insert(i int) {
39
n := &Node{Value: i}
Callers
1
TestTree
Function · 0.85
Calls
no outgoing calls
Tested by
1
TestTree
Function · 0.68