Predecessor returns the Predecessor of the node of Key if there is no predecessor, return default value of type T and false otherwise return the Key of predecessor and true
(key T)
| 151 | // if there is no predecessor, return default value of type T and false |
| 152 | // otherwise return the Key of predecessor and true |
| 153 | func (avl *AVL[T]) Predecessor(key T) (T, bool) { |
| 154 | node, ok := searchTreeHelper[T](avl.Root, avl._NIL, key) |
| 155 | if !ok { |
| 156 | var dft T |
| 157 | return dft, ok |
| 158 | } |
| 159 | return predecessorHelper[T](node, avl._NIL) |
| 160 | } |
| 161 | |
| 162 | // Successor returns the Successor of the node of Key |
| 163 | // if there is no successor, return default value of type T and false |
nothing calls this directly
no outgoing calls
no test coverage detected