web/ravl.js
Matej Focko 43ade1120b
fix: Ensure all affected nodes are being highlighted
Fixes #9

Signed-off-by: Matej Focko <mfocko@redhat.com>
2022-05-16 18:36:31 +02:00

22 lines
498 B
JavaScript

class RAVLTree extends WAVLTree {
isCorrectNode(node, recursive) {
if (!node) {
return true;
}
if (!nodeDifferences(node).filter((d) => d <= 0).length > 0) {
return false;
}
return (
!recursive ||
(this.isCorrectNode(node.left) && this.isCorrectNode(node.right))
);
}
deleteRebalance(node, parent) {
// no-op
this.record("No rebalancing occurs");
return;
}
}