Programming Interview: Deletion of node from Binary Search Tree (BST)

preview_player
Показать описание
This video lecture is produced by S. Saurabh. He is B.Tech from IIT and MS from USA.

binary search tree delete node
delete a node from binary tree in c
deletion in binary search tree algorithm

delete node binary search tree c
delete node binary search tree java
algorithm to delete a node from binary search tree
binary search tree delete node c++
binary search tree in data structure
binary search tree algorithm
binary search tree example

To prepare for programming Interview Questions on Binary Trees

To study programming Interview questions on Stack, Queues, Arrays visit

To watch all Programming Interview Questions visit

To learn about Pointers in C visit

To learn C programming from IITian S.Saurabh visit
Рекомендации по теме
Комментарии
Автор

Hi Saurabh sir,
Once more I need your help regarding BST
We need a good video for
1. BST Split procedure with a good algorithm
2. BST twoWayJoin operation with algorithm
3. BST threeWayJoin operation with algorithm

Please provide them as early as possible. Really difficult to find good stuff in youtube.


Thanks,
Anes

anesp.a
Автор

it is a simple pen tablet which comes with its software that helps in producing whatever i write on pen tablet surface. Then I use camstudio which helps me record my voice and screen

saurabhschool
Автор

Hi Saurabh,
Really good job.
I refer this whenever I have interview

ankitk
Автор

I am confused now about earlier discussion, where we said If right child is not there go up the parental nodes and find the one which is the left child, , and that is the successor. There is no example of that, can you delete 14 (from 9.43 onwards)and show us what happens.

If right child is not there, then does it become the second case where one child is not there, then in that case why do we need to calculate ancestor?

ravindrabhatt
Автор

What if you wanted to delete all nodes within a specified range?

nextlvlroy
Автор

Hello, While removing node with 2 children why did you move 6? Why not 3? That would still maintain the BST property

ravindrabhatt
Автор

Hi Saurabh! Is it possible to delete node from binary tree using while loop ?

sivarammchitithoti
Автор

Hi Saurabh, While finding successor, What happens if there is no left child and there is right sub tree at 9.10? 

Also, In the entire pusedo code, the tree successor can return Max node in the path, if right child != Null. How is this case handled?

What is the right sub tree is null? at 6.29, , please explain
Also, why are we doing left(y) != Null, , it has to be null otherwise we would go further left and that would be predessor. If Y has a child it has to be right child?

Also Right of parent of Y can be another tree, , How is the else statement correct? the while color if case at 12.21

ravindrabhatt
Автор

Not sure deleting 18 is done correct as, there is a right child, in that case, 19 is the successor, so we have to copy 19 in place of 18 and delete 18., , Could you confirm Saurabh?

ravindrabhatt
Автор

Hey saurabh, I have one question whats the software you are using with tablet to write or is it provided with your pad. If you know any other software please tell.

piyushalbert
Автор

Hi. Your examples of your explanations do not follow the proper criteria for a binary search tree. The nodes would never be sorted in that order. Therefore your deletion algorithms do not produce required results. Please refer to delete by copying and delete by merging algorithms for the correct implementation of binary tree deletion operations.

TheSyndrome