MCPcopy 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
16func (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
26type Tree struct {
27 Head *Node

Callers 4

TestTreeFunction · 0.95
InsertMethod · 0.95
DeleteMethod · 0.95
SearchMethod · 0.80

Calls

no outgoing calls

Tested by 1

TestTreeFunction · 0.76