Deletion in Binary Search Tree (Implementation)
Learn to write the implementation of the deletion function, which covers all the cases that were discussed previously.
Introduction
Implement the delete function for BSTs. You will build upon the code as you cater for each case.
1. Deleting an empty tree
Start with a skeleton function definition and cater for the first case. Return false
if the root
is null
.
Level up your interview prep. Join Educative to access 80+ hands-on prep courses.