Yes.... I was also thinking the same...... I thought I might be wrong ..... but I have considered all the cases and I think things can be done in both ways
Nice video. nice explanation. I would like to correct a point that is you mentioned that you have to always take the inorder successor to replace the about to be deleted node but it is also possible to consider the inorder predecessor. Please do write back. I like the way you explain. Thank you :) good job
There is another alternative to do children deletion, bring up the left sub tree at parent place of deletion and add right node(sub-tree) towards the rightmost node of the left sub-tree, it will save the searching time
Hi, Like you have said find minimum in right subtree. But in your algo you are continousouly moving while(p!=nulll) { p->p.left } thats ok but with your last Tree if you delete 20 than you have replaced it with 30 but according to your algo you have to replace it with 35 i.e wrong. Please give your suggestion on it.
You are wrong at your own statement... 35 wasn't at left. it was at RIght... on the 30 left is NULL so the Algo found 30 the right option... while P is not equal to NULL it will naturally be the lowest number in the right sub-tree because of the property of BST
Nice video. I just have a simple question. For the 2-children deletion, the node with minimum value of right subtree is used for replacement. So, why can't the node with maximum value of left subtree be used?
we can replace the node with the from the left sub tree that is "maximum value in the left subtree we will move first from the parent node to the left and then keep in moving to the right to find the maximum untill we hit None .and that value will be replaced with parent node so that new value would be less as its from left subtree and being maximum we can say that all the values in the left tree of that is lesser than that
Nice video sir...urs video helps me a lot for understanding the coding easily thank u sir...plss upload proper coding for deleting node in bst...I will be waiting for that video sir...
where s the code for this ? I did not see a video which has the code for deletion....if you can please upload the video / share the code link , that will be great...
I would like to ask that in your delete a node in BST you asaid we can only choose the smallest from right sub-tree but we can also choose the largest from left sub-tree isn't it true ?
Video tells about deleting a node with 2 children with making Inorder successor as replacable element. Can we make Inorder predecessor also as replacable element? So at 21:56 timestamp of the video, 9 has two children a & b and Inorder predecessor of 12 will be b and we can replace b. Please correct me if I am wrong.
is there anyone thinking, for a node with 2 children, why can't we replace the node with the right child and move the left subtree as a left child to the inorder successor? In the scenario of 14:48, why can't we move 10 (along with its children) and make it as the left child of 35 whereas 30 can take the position of 20, directly connected to 50? It will preserve the properties of BST and inorder traversal.
we can replace the node with the from the left sub tree that is "maximum value in the left subtree we will move first from the parent node to the left and then keep in moving to the right to find the maximum untill we hit None .and that value will be replaced with parent node so that new value would be less as its from left subtree and being maximum we can say that all the values in the left tree of that is lesser than that !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!WRONG EXPLANATION!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
sir at last you have teach wrong we could delete inorder predecessor there is no need to fit two children because one of the children will be just smaller than the node to be deleted
Awesome explanation! Indian's are the best computer teachers, it explain everything so clearly, slowly and datailled. You gained a Subscriptor
Thanks Leviatan
When I see your face in any results of google .. I feel calm ... I will understand it .. you are so important like this
your teaching skills are amazing. you make us understand complex problem in a very simplified way.
he is the most innocent teacher I've ever seen on youtube
Sir, you are a Master Warrior of Algorirhms ! Thank you so much I now understand thank you Sir Warrior !!
Sir, Your Teaching style is awesome. You explain concepts in a simple way making it easy to understand. Thank you so much.
21:55 we can use the greatest value from left subtree and substitute it in place of 12 , BST property is preserved and so is the Inorder traversal.
Exactly i wondered why he didnt explain that scenario
Yes.... I was also thinking the same...... I thought I might be wrong ..... but I have considered all the cases and I think things can be done in both ways
One can use either inorder predecessor(largest from left subtree) or inorder successor(smallest from right subtree). Its a choice of developer.
I am not exaggerating, but you really are the best teacher of Data structures
Explained a complex topic by simplified method 😊
this man helps me a lot....if I find him I will treat him.....
Nice video. nice explanation. I would like to correct a point that is you mentioned that you have to always take the inorder successor to replace the about to be deleted node but it is also possible to consider the inorder predecessor. Please do write back. I like the way you explain. Thank you :) good job
brother do u have the link of the next video?
is that max of the left sub tree ?
Sir, Your explanantions are the best..
You just saved my semester! Thanks brother xD
videos are in random order so, please arrange in the serial wise please.
Very very good. The best indian in the business
There is another alternative to do children deletion, bring up the left sub tree at parent place of deletion and add right node(sub-tree) towards the rightmost node of the left sub-tree, it will save the searching time
After Watching Your Video I Am Able To Progarm The Deletion of a Node From The Tree...
Amazing explanation I struggled with with step to take, minimum but now it's clear thank you sir.
Great job sir keep doing
Fantastic explanation and examples sir
dang you do a really good job at explaining wish my professor was as detailed
Hi,
Like you have said find minimum in right subtree. But in your algo you are continousouly moving
while(p!=nulll) {
p->p.left
}
thats ok but with your last Tree if you delete 20 than you have replaced it with 30 but according to your algo you have to replace it with 35 i.e wrong. Please give your suggestion on it.
You are wrong at your own statement... 35 wasn't at left. it was at RIght... on the 30 left is NULL so the Algo found 30 the right option... while P is not equal to NULL it will naturally be the lowest number in the right sub-tree because of the property of BST
Thankyouuuuu sir.... I was looking for such detailed explaination
I think we can replace the max number in the left subtree with the node we want to delete when we are doing with 2 children.
amazing video sir ,you are great,
sir , can you explain it coding
Nice video. I just have a simple question.
For the 2-children deletion, the node with minimum value of right subtree is used for replacement. So, why can't the node with maximum value of left subtree be used?
we can replace the node with the from the left sub tree that is "maximum value in the left subtree we will move first from the parent node to the left and then keep in moving to the right to find the maximum untill we hit None .and that value will be replaced with parent node so that new value would be less as its from left subtree and being maximum we can say that all the values in the left tree of that is lesser than that
Nice video sir...urs video helps me a lot for understanding the coding easily thank u sir...plss upload proper coding for deleting node in bst...I will be waiting for that video sir...
where s the code for this ? I did not see a video which has the code for deletion....if you can please upload the video / share the code link , that will be great...
Super class. Could you please share the code for deleting
22:14 is a good example of Heisenberg's principle.
Nice handwriting
please dont stop making this type of videos.
awesome explanation
This is so helpful.. Thank you sir
Sir your explanation is really very very osam😍🤗
Hello Sir,
Where is the next video of code explanation ?
God bless you sir
I would like to ask that in your delete a node in BST you asaid we can only choose the smallest from right sub-tree but we can also choose the largest from left sub-tree isn't it true ?
Yes we can replace the element to be deleted with its predecessor also
Video tells about deleting a node with 2 children with making Inorder successor as replacable element. Can we make Inorder predecessor also as replacable element? So at 21:56 timestamp of the video, 9 has two children a & b and Inorder predecessor of 12 will be b and we can replace b. Please correct me if I am wrong.
very clear explanation
Very clear explanation.
Great explanation in detail, thank you!!
nice work. Please make videos on graph and dynamic prog, greedy topics. Aur Obviously bda sahi bolte ho :)
is there anyone thinking, for a node with 2 children, why can't we replace the node with the right child and move the left subtree as a left child to the inorder successor? In the scenario of 14:48, why can't we move 10 (along with its children) and make it as the left child of 35 whereas 30 can take the position of 20, directly connected to 50? It will preserve the properties of BST and inorder traversal.
The arrangement of the tree is disturbed in that case for eg 35 was connected to null but now 35 will be connected to 10 in that case .
Plz explain a c program...for searching an element in BST
N also inserting an element in BST
This is so helpful!!! Thank you sir!
sir in which video we can find the code
you are the best sir!!!
nice video. can you post a video about what is time complexity term means? like O(n) O(n^2) and all?
Please upload code of this deletion
nice video......thank alot your lecture helps me alot
Can't we find the max in the left tree similar to what you are doing with finding min in the right tree?
Yes we can find i think sir isn't aware about it
Thank you; very helpful refresher
One Correction: Deleting non leaf which has 2 nodes, replacing it with in-order predecessor will also work.
what happens if we delete the root?
Very useful.....Great job
its awesome sir......nice explanation
Sir but can we use inorder predecessor for replacement just like we used inorder successor ?
yes u can
Great video!!! You deserve more subscribers!
simply loved it ❤️❤️
excellent but can you make a video explained the code with recursion is a little complcated , thanks for the help
god bless you
Thank you vary much.
Very well explained :)
thank u sir
In the last case can we replace 12 which is to be deleted with maximum of the left subtree that is b?
can you please explain general tree
i like your explanation.
good job.
awesome tutorial...where is the link of next video ???
thank you, sir
we can replace the node with the from the left sub tree that is "maximum value in the left subtree we will move first from the parent node to the left and then keep in moving to the right to find the maximum untill we hit None .and that value will be replaced with parent node so that new value would be less as its from left subtree and being maximum we can say that all the values in the left tree of that is lesser than that
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!WRONG EXPLANATION!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Cn you post the code for Delete a node from Binary Search Tree.
excellent
Thank you.
/thanks a lot sir for explaining
Sir plz tell if we want to delete root node in BST then how we can delete it
Nice video😁😁
Thank you Sir
we want the program also
thanks, nice explanation
Sir agar mera kisi coding company mein job laga Main sabse pehle aap hi mithai khilaoonga
Is there the proper code we can find by this algorithm?
Ruhani Choudhary tonns of codes are already being there over the internet. you can simply search over the Google.
on github of vivekanand sir
sir can you post some videos on hashing
@22min Sir even right child may also have children.
Where is the next video As you told , for coding..
Thank you for the clear explanation! :-)
Amazing good job bro !!!
sir at last you have teach wrong we could delete inorder predecessor there is no need to fit two children because one of the children will be just smaller than the node to be deleted
sir please provide the actual code of deletion in bst
All adobe premier pro transition effects are used in this video :)
thanks sir
Where is code
thankks you very very much i loved it
sir where is the link to the next video?
PLEASE POST CODE FOR THE SAME
Good
Please make video to delete root node
Root node is the same as deleting a node with 2 childern
Thanx
At 22:01 time... why cant we replace maximum of the left subtree?
we can... either maximum of left subtree or minimum in right subtree...
Gem
where is the code?????????????/