mirror of
https://github.com/trekhleb/javascript-algorithms.git
synced 2026-03-13 08:51:02 +08:00
Fix BST removal method.
This commit is contained in:
@@ -81,7 +81,7 @@ export default class BinarySearchTreeNode extends BinaryTreeNode {
|
||||
|
||||
/**
|
||||
* @param {*} value
|
||||
* @return {BinarySearchTreeNode}
|
||||
* @return {boolean}
|
||||
*/
|
||||
remove(value) {
|
||||
const nodeToRemove = this.find(value);
|
||||
@@ -120,7 +120,7 @@ export default class BinarySearchTreeNode extends BinaryTreeNode {
|
||||
}
|
||||
}
|
||||
|
||||
return nodeToRemove;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user