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