I'm studying AVL trees for a large homework I have, 2 of the functions that need to be implemented are the successor
and predecessor
I've looked around on the internet and only found how to implement code to find the two, not why or when it can be used, not enough.
Duplicates are not allowed in the tree, the tree is a standard AVL tree implementation with rotate
functions, insert
and delete
functions, the keys are int
.
I recall once my tutor told me that you ''keep copying'' predecessors or successors successively until you reach a leaf node to help with node deletion is this true, or something similar like this?
I don't know which part of the file(s) to show for this question, it's a big one and It's not really a question about a specific code.