Successor returns the Successor of the node of Key if there is no successor, return default value of type T and false otherwise return the Key of successor and true
(key T)
| 155 | // if there is no successor, return default value of type T and false |
| 156 | // otherwise return the Key of successor and true |
| 157 | func (t *BinarySearch[T]) Successor(key T) (T, bool) { |
| 158 | node, ok := searchTreeHelper[T](t.Root, t._NIL, key) |
| 159 | if !ok { |
| 160 | var dft T |
| 161 | return dft, ok |
| 162 | } |
| 163 | return successorHelper[T](node, t._NIL) |
| 164 | } |
| 165 | |
| 166 | func (t *BinarySearch[T]) pushHelper(x *BSNode[T], val T) { |
| 167 | y := t._NIL |
nothing calls this directly
no outgoing calls
no test coverage detected