55.2k views
3 votes
When exceeding the threshold on balance, at the start of SHAB where does pointerInParent point?

User Breek
by
8.5k points

1 Answer

3 votes

Final answer:

When exceeding the threshold on balance at the start of SHAB, the pointerInParent points to the root node.

Step-by-step explanation:

When exceeding the threshold on balance at the start of SHAB, the pointerInParent points to the root node. In a self-balancing binary search tree like SHAB (Scapegoat Tree), the pointerInParent is used to keep track of the parent node during insertion or deletion.

When the balance threshold is exceeded, the tree is restructured to maintain balance, and the root node may change. Therefore, pointerInParent is updated to point to the new root node.

User SirSaleh
by
6.9k points

Related questions

1 answer
1 vote
58.0k views
asked Mar 9, 2022 38.9k views
Sergei Belous asked Mar 9, 2022
by Sergei Belous
8.7k points
2 answers
4 votes
38.9k views