You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
change:
if (this.getBalanceFactor(node.left) === BalanceFactor.SLIGHTLY_UNBALANCED_RIGHT) {
return this.rotationLR(node.left);
}
to:
if (this.getBalanceFactor(node.left) === BalanceFactor.SLIGHTLY_UNBALANCED_RIGHT) {
return this.rotationLR(node);
}
Same thing on the right
@XwBourne agree with you that the equals should be removed here, and furthermore, we can even use the same code logic in the insertNode function, because the key comparison function can tell where the removed node comes from, which can save some function calls of getTreeHeight as the getBalanceFactor is calling it every time
@loiane I raised a PR on this #193, on this PR I also add some fixes and updates, details are included in the PR.
Attempted a removeNode using both the github's and site's downloadable code for the Self-balancing tree.
Error received are as follows:
Insertion of keys were carried out first, as reflected below:
The text was updated successfully, but these errors were encountered: