Min returns the Min value of the tree
()
| 140 | |
| 141 | // Min returns the Min value of the tree |
| 142 | func (t *RB[T]) Min() (T, bool) { |
| 143 | ret := minimum[T](t.Root, t._NIL) |
| 144 | if ret == t._NIL { |
| 145 | var dft T |
| 146 | return dft, false |
| 147 | } |
| 148 | return ret.Key(), true |
| 149 | } |
| 150 | |
| 151 | // Predecessor returns the Predecessor of the node of Key |
| 152 | // if there is no predecessor, return default value of type T and false |