Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/arnauddri/algorithms
/ Compare
Method
Compare
data-structures/binary-tree/bst.go:16–24 ·
view source on GitHub ↗
(m *Node)
Source
from the content-addressed store, hash-verified
14
}
15
16
func
(n *Node) Compare(m *Node) int {
17
if
n.Value < m.Value {
18
return
-1
19
}
else
if
n.Value > m.Value {
20
return
1
21
}
else
{
22
return
0
23
}
24
}
25
26
type
Tree
struct
{
27
Head *Node
Callers
4
TestTree
Function · 0.95
Insert
Method · 0.95
Delete
Method · 0.95
Search
Method · 0.80
Calls
no outgoing calls
Tested by
1
TestTree
Function · 0.76