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