Binary Search Trees Flashcards
1
Q
BST time complexity
- search
- add
- remove
A
2
Q
what is pointer reinforcement
A
when traversing down the tree, certain operations on a given node might yield a different resulting tree in the end.
Since tree traversal is done using recursions, every stack in the callstack, once it’s returned, will affect its previous stack.
Therefore, to utilize current stack’s influence on preivous one, we set the previous point to the current one so that when the current one is returned, anything before will be updated on the change
3
Q
how to remove a 2-child node from a BST using successor mode?
A
4
Q
how to remove a 2-child node from a BST using predecessor mode?
A