MCPcopy Create free account
hub / github.com/TheAlgorithms/Go / Max

Method Max

structure/tree/rbtree.go:132–139  ·  view source on GitHub ↗

Max returns the Max value of the tree

()

Source from the content-addressed store, hash-verified

130
131// Max returns the Max value of the tree
132func (t *RB[T]) Max() (T, bool) {
133 ret := maximum[T](t.Root, t._NIL)
134 if ret == t._NIL {
135 var dft T
136 return dft, false
137 }
138 return ret.Key(), true
139}
140
141// Min returns the Min value of the tree
142func (t *RB[T]) Min() (T, bool) {

Callers

nothing calls this directly

Calls 1

KeyMethod · 0.65

Tested by

no test coverage detected