...
/Deletion in Binary Search Tree (Implementation)
Deletion in Binary Search Tree (Implementation)
We will now write the implementation of the delete function which covers all the cases that we discussed previously.
Introduction #
Let’s implement the delete function for BSTs. We’ll build upon the code as we cater to each case.
1. Deleting an Empty Tree #
Let’s start with a skeleton function definition and cater to the first case. We return false
if the root node is null
.
In our current implementation of JavaScript, we always initialize an object of the ...