mirror of
https://github.com/trekhleb/javascript-algorithms.git
synced 2026-03-13 08:51:02 +08:00
Add binary search tree.
This commit is contained in:
@@ -14,7 +14,7 @@ export default class BinarySearchTree {
|
||||
}
|
||||
|
||||
remove(value) {
|
||||
const nodeToRemove = this.findNode(value);
|
||||
const nodeToRemove = this.root.find(value);
|
||||
|
||||
if (!nodeToRemove) {
|
||||
throw new Error('Item not found in the tree');
|
||||
|
||||
Reference in New Issue
Block a user