mirror of
https://github.com/trekhleb/javascript-algorithms.git
synced 2026-03-13 08:51:02 +08:00
Fix binary tree node.
This commit is contained in:
@@ -32,13 +32,17 @@ export default class BinaryTreeNode {
|
||||
|
||||
setLeft(node) {
|
||||
this.left = node;
|
||||
this.left.parent = this;
|
||||
if (node) {
|
||||
this.left.parent = this;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
setRight(node) {
|
||||
this.right = node;
|
||||
this.right.parent = this;
|
||||
if (node) {
|
||||
this.right.parent = this;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user