Welcome to the daily solving of our PROBLEM OF THE DAY with Karan Mashru. We will discuss the entire problem step-by-step and work towards developing an optimized solution. This will not only help you brush up on your concepts of Self-balancing BST but will also help you build up problem-solving skills.
In this problem, we are given an AVL tree and N values to be deleted from the tree. Our task is to write a function to delete a given value from the tree. All the N values which needs to be deleted are passed one by one as input data by driver code itself, we are asked to return the root of modified tree after deleting the value.
Example :
Tree =
4
/ \
2 6
/ \ / \
1 3 5 7
N = 4
Values to be deleted = {4,1,3,6}
Give the problem a try before going through the video. All the best!!!
Problem Link: https://practice.geeksforgeeks.org/problems/avl-tree-deletion/1