Binary Search Trees Flashcards

1
Q

BST time complexity
- search
- add
- remove

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

how to remove a 2-child node from a BST using successor mode?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

how to remove a 2-child node from a BST using predecessor mode?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly