We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

Delete

We also need a way to remove users from our BST if a user decides to delete their account.

Assignment

Implement the recursive delete method. It takes a value as an input and deletes the node with that value if it exists. Each call returns the new root of the tree (or subtree) after the deletion.

Notice that in the test suite the delete method is called like this:

bst = bst.delete(character)