mirror of
https://github.com/trekhleb/javascript-algorithms.git
synced 2026-03-13 08:51:02 +08:00
Return removed nodes in BST.
This commit is contained in:
@@ -10,9 +10,10 @@ export default class BinarySearchTree {
|
||||
|
||||
/**
|
||||
* @param {*} value
|
||||
* @return {BinarySearchTreeNode}
|
||||
*/
|
||||
insert(value) {
|
||||
this.root.insert(value);
|
||||
return this.root.insert(value);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -25,6 +26,7 @@ export default class BinarySearchTree {
|
||||
|
||||
/**
|
||||
* @param {*} value
|
||||
* @return {BinarySearchTreeNode}
|
||||
*/
|
||||
remove(value) {
|
||||
return this.root.remove(value);
|
||||
|
||||
Reference in New Issue
Block a user