MCPcopy Index your code
hub / github.com/TheAlgorithms/Go / Max

Method Max

structure/tree/bstree.go:123–130  ·  view source on GitHub ↗

Max returns the Max value of the tree

()

Source from the content-addressed store, hash-verified

121
122// Max returns the Max value of the tree
123func (t *BinarySearch[T]) Max() (T, bool) {
124 ret := maximum[T](t.Root, t._NIL)
125 if ret == t._NIL {
126 var dft T
127 return dft, false
128 }
129 return ret.Key(), true
130}
131
132// Min returns the Min value of the tree
133func (t *BinarySearch[T]) Min() (T, bool) {

Callers

nothing calls this directly

Calls 1

KeyMethod · 0.65

Tested by

no test coverage detected