Open
Description
Missing update parent. It should be
if (!nodeToReplace || !replacementNode) {
return false;
}
if (this.left && this.left === nodeToReplace) {
this.left = replacementNode;
replacementNode.parent = this;
return true;
}
if (this.right && this.right === nodeToReplace) {
this.right = replacementNode;
replacementNode.parent = this;
return true;
}
return false;
}
Metadata
Metadata
Assignees
Labels
No labels