Delete a node from Binary Search Tree( Reason for every operation explained)

Поділитися
Вставка
  • Опубліковано 6 лис 2024

КОМЕНТАРІ • 133

  • @leviatanx6662
    @leviatanx6662 3 роки тому +5

    Awesome explanation! Indian's are the best computer teachers, it explain everything so clearly, slowly and datailled. You gained a Subscriptor

  • @ayaramzy6815
    @ayaramzy6815 3 роки тому

    When I see your face in any results of google .. I feel calm ... I will understand it .. you are so important like this

  • @rohitbhelkar2712
    @rohitbhelkar2712 4 роки тому +1

    your teaching skills are amazing. you make us understand complex problem in a very simplified way.

  • @bestdeal3385
    @bestdeal3385 3 роки тому +2

    he is the most innocent teacher I've ever seen on youtube

  • @exe.m1dn1ght
    @exe.m1dn1ght Місяць тому

    Sir, you are a Master Warrior of Algorirhms ! Thank you so much I now understand thank you Sir Warrior !!

  • @kanchanharjani1891
    @kanchanharjani1891 3 роки тому

    Sir, Your Teaching style is awesome. You explain concepts in a simple way making it easy to understand. Thank you so much.

  • @abhinavrana8157
    @abhinavrana8157 6 років тому +17

    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.

    • @myerali8257
      @myerali8257 5 років тому +4

      Exactly i wondered why he didnt explain that scenario

    • @aryanbisht7752
      @aryanbisht7752 4 роки тому

      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

    • @krishnendudutta1465
      @krishnendudutta1465 4 роки тому +7

      One can use either inorder predecessor(largest from left subtree) or inorder successor(smallest from right subtree). Its a choice of developer.

  • @vikasvishwakarma5263
    @vikasvishwakarma5263 6 років тому +5

    I am not exaggerating, but you really are the best teacher of Data structures

  • @Anonymous-mm9tt
    @Anonymous-mm9tt Рік тому

    Explained a complex topic by simplified method 😊

  • @fardilviews
    @fardilviews 4 роки тому

    this man helps me a lot....if I find him I will treat him.....

  • @manojbgm
    @manojbgm 7 років тому +6

    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

    • @Armaghan619
      @Armaghan619 7 років тому

      brother do u have the link of the next video?

    • @quickbitesitsme
      @quickbitesitsme 4 роки тому

      is that max of the left sub tree ?

  • @AbhishekKumar-eh6zy
    @AbhishekKumar-eh6zy 3 роки тому

    Sir, Your explanantions are the best..

  • @avinashravi_
    @avinashravi_ 6 років тому +18

    You just saved my semester! Thanks brother xD

  • @royalegaming9801
    @royalegaming9801 2 роки тому +1

    videos are in random order so, please arrange in the serial wise please.

  • @FredoCorleone
    @FredoCorleone 5 років тому

    Very very good. The best indian in the business

  • @johnsonmathew6008
    @johnsonmathew6008 5 років тому +1

    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

  • @yogeshverma2875
    @yogeshverma2875 5 років тому

    After Watching Your Video I Am Able To Progarm The Deletion of a Node From The Tree...

  • @siddharthkshirsagar540
    @siddharthkshirsagar540 4 роки тому

    Amazing explanation I struggled with with step to take, minimum but now it's clear thank you sir.

  • @rahulmehra186
    @rahulmehra186 3 роки тому +1

    Great job sir keep doing

  • @hallvardlundehervig5508
    @hallvardlundehervig5508 5 років тому

    Fantastic explanation and examples sir

  • @Just1MorePerson1
    @Just1MorePerson1 7 років тому +2

    dang you do a really good job at explaining wish my professor was as detailed

  • @anshul90100
    @anshul90100 6 років тому +1

    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.

    • @haroonkuta
      @haroonkuta 6 років тому

      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

  • @AnjaliSharma-lq8ut
    @AnjaliSharma-lq8ut Рік тому

    Thankyouuuuu sir.... I was looking for such detailed explaination

  • @tensu6835
    @tensu6835 10 місяців тому

    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.

  • @vrushantdomde1070
    @vrushantdomde1070 5 років тому +4

    amazing video sir ,you are great,
    sir , can you explain it coding

  • @foo.1396
    @foo.1396 6 років тому +1

    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?

    • @supamdeepbains5172
      @supamdeepbains5172 6 років тому

      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

  • @haseenashaik6198
    @haseenashaik6198 6 років тому

    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...

  • @punitpawar1
    @punitpawar1 3 роки тому +1

    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...

  • @shalomabraham5229
    @shalomabraham5229 3 роки тому

    Super class. Could you please share the code for deleting

  • @live_cuh_reaction
    @live_cuh_reaction 3 роки тому

    22:14 is a good example of Heisenberg's principle.

  • @mr.anonymous6098
    @mr.anonymous6098 3 роки тому +1

    Nice handwriting

  • @tusharbarman1924
    @tusharbarman1924 5 років тому

    please dont stop making this type of videos.

  • @citruspun
    @citruspun 2 місяці тому

    awesome explanation

  • @saptarshichattopadhyay8234
    @saptarshichattopadhyay8234 2 роки тому

    This is so helpful.. Thank you sir

  • @Farahat1234
    @Farahat1234 6 років тому

    Sir your explanation is really very very osam😍🤗

  • @MyLifeMyWorld08
    @MyLifeMyWorld08 6 років тому +3

    Hello Sir,
    Where is the next video of code explanation ?

  • @Farahat1234
    @Farahat1234 6 років тому +1

    God bless you sir

  • @SahilSharma-zz8nv
    @SahilSharma-zz8nv 5 років тому +1

    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 ?

    • @AjeetKumar-mo6xt
      @AjeetKumar-mo6xt 5 років тому

      Yes we can replace the element to be deleted with its predecessor also

  • @Karthik7070
    @Karthik7070 7 років тому

    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.

  • @digitalx788
    @digitalx788 5 років тому

    very clear explanation

  • @girardroston370
    @girardroston370 6 років тому

    Very clear explanation.

  • @hailemariamtamirat3125
    @hailemariamtamirat3125 3 роки тому

    Great explanation in detail, thank you!!

  • @the-gray-haired-developer
    @the-gray-haired-developer 5 років тому

    nice work. Please make videos on graph and dynamic prog, greedy topics. Aur Obviously bda sahi bolte ho :)

  • @sebinvincent4009
    @sebinvincent4009 3 роки тому

    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.

    • @mirangpuri6057
      @mirangpuri6057 3 роки тому

      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 .

  • @dr.padmajapulicherla5545
    @dr.padmajapulicherla5545 5 років тому

    Plz explain a c program...for searching an element in BST
    N also inserting an element in BST

  • @sohbetdovranov9798
    @sohbetdovranov9798 6 років тому +2

    This is so helpful!!! Thank you sir!

  • @ShubhamTiwari-ks2qg
    @ShubhamTiwari-ks2qg 3 роки тому

    sir in which video we can find the code

  • @salmasulthana3320
    @salmasulthana3320 3 роки тому

    you are the best sir!!!

  • @subhranil_mukherjee
    @subhranil_mukherjee 7 років тому +15

    nice video. can you post a video about what is time complexity term means? like O(n) O(n^2) and all?

  • @aqsaibrahim5561
    @aqsaibrahim5561 6 років тому

    nice video......thank alot your lecture helps me alot

  • @HemantSingh-pr7hd
    @HemantSingh-pr7hd 4 роки тому

    Can't we find the max in the left tree similar to what you are doing with finding min in the right tree?

    • @SandeshMotoVlogs
      @SandeshMotoVlogs 3 роки тому

      Yes we can find i think sir isn't aware about it

  • @anushirawan
    @anushirawan 3 роки тому

    Thank you; very helpful refresher

  • @xiangwingrace8672
    @xiangwingrace8672 6 років тому

    One Correction: Deleting non leaf which has 2 nodes, replacing it with in-order predecessor will also work.

  • @pradeepasivanesan
    @pradeepasivanesan 5 років тому +1

    what happens if we delete the root?

  • @varsh5020
    @varsh5020 6 років тому

    Very useful.....Great job

  • @judisjeevan4908
    @judisjeevan4908 7 років тому

    its awesome sir......nice explanation

  • @AddieInGermany
    @AddieInGermany 7 років тому +2

    Sir but can we use inorder predecessor for replacement just like we used inorder successor ?

  • @chenzhuo9
    @chenzhuo9 3 роки тому

    Great video!!! You deserve more subscribers!

  • @thebishalpaul
    @thebishalpaul 3 роки тому

    simply loved it ❤️❤️

  • @amateurbeginner7538
    @amateurbeginner7538 7 років тому

    excellent but can you make a video explained the code with recursion is a little complcated , thanks for the help

  • @ragibshahariar6852
    @ragibshahariar6852 4 роки тому +1

    god bless you

  • @souravbhowmik9477
    @souravbhowmik9477 3 роки тому

    Thank you vary much.

  • @pawandeepchor89
    @pawandeepchor89 6 років тому +1

    Very well explained :)

  • @GurpreetSingh-yy5fn
    @GurpreetSingh-yy5fn 3 роки тому +1

    thank u sir

  • @samarthbh
    @samarthbh 7 років тому

    In the last case can we replace 12 which is to be deleted with maximum of the left subtree that is b?

  • @mounikasingireddy93
    @mounikasingireddy93 4 роки тому

    can you please explain general tree

  • @talentamesiannasitorus3833
    @talentamesiannasitorus3833 6 років тому

    i like your explanation.
    good job.

  • @a_l_o_k_1991
    @a_l_o_k_1991 6 років тому

    awesome tutorial...where is the link of next video ???

  • @ahmedabdelreheem4723
    @ahmedabdelreheem4723 2 місяці тому

    thank you, sir

  • @supamdeepbains5172
    @supamdeepbains5172 6 років тому +8

    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!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

  • @ranjan19able
    @ranjan19able 5 років тому

    Cn you post the code for Delete a node from Binary Search Tree.

  • @PramodRj
    @PramodRj 4 роки тому

    excellent

  • @nackyding
    @nackyding 4 роки тому

    Thank you.

  • @TheMiracle96
    @TheMiracle96 5 років тому

    /thanks a lot sir for explaining

  • @satnamsatta1144
    @satnamsatta1144 6 років тому

    Sir plz tell if we want to delete root node in BST then how we can delete it

  • @aparnanandakumar2730
    @aparnanandakumar2730 5 років тому

    Nice video😁😁

  • @samiramaniyar1984
    @samiramaniyar1984 6 років тому

    Thank you Sir

  • @rejinapv2472
    @rejinapv2472 3 роки тому

    we want the program also

  • @stevefrt9495
    @stevefrt9495 7 років тому

    thanks, nice explanation

  • @VY-zt3ph
    @VY-zt3ph 5 років тому

    Sir agar mera kisi coding company mein job laga Main sabse pehle aap hi mithai khilaoonga

  • @ruhani2803
    @ruhani2803 7 років тому +2

    Is there the proper code we can find by this algorithm?

    • @lyfokzz3848
      @lyfokzz3848 6 років тому +1

      Ruhani Choudhary tonns of codes are already being there over the internet. you can simply search over the Google.

    • @prashantshukla7203
      @prashantshukla7203 6 років тому

      on github of vivekanand sir

  • @sagarpatil-js1fy
    @sagarpatil-js1fy 6 років тому

    sir can you post some videos on hashing

  • @basavarajpatil9821
    @basavarajpatil9821 3 роки тому

    @22min Sir even right child may also have children.

  • @rajeshdey1441
    @rajeshdey1441 4 роки тому

    Where is the next video As you told , for coding..

  • @pranavbhat92
    @pranavbhat92 6 років тому

    Thank you for the clear explanation! :-)

  • @lamcao8443
    @lamcao8443 3 роки тому

    Amazing good job bro !!!

  • @adityajha9900
    @adityajha9900 3 роки тому

    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

  • @sudhanshuagrawal8598
    @sudhanshuagrawal8598 6 років тому

    sir please provide the actual code of deletion in bst

  • @anuragv400
    @anuragv400 4 роки тому

    All adobe premier pro transition effects are used in this video :)

  • @dinosaurx6851
    @dinosaurx6851 6 років тому

    thanks sir

  • @aanchalsharma5264
    @aanchalsharma5264 5 років тому

    Where is code

  • @RahulPatel-hr4qe
    @RahulPatel-hr4qe 6 років тому

    thankks you very very much i loved it

  • @Armaghan619
    @Armaghan619 7 років тому

    sir where is the link to the next video?

  • @nikhilverma882
    @nikhilverma882 5 років тому

    PLEASE POST CODE FOR THE SAME

  • @Prabhakar-bh2cv
    @Prabhakar-bh2cv 5 років тому

    Good

  • @zaryabzubair8393
    @zaryabzubair8393 2 роки тому

    Please make video to delete root node

    • @MrSahilkaura
      @MrSahilkaura 2 роки тому

      Root node is the same as deleting a node with 2 childern

  • @cvismenu
    @cvismenu 7 років тому

    Thanx

  • @manishshambu2612
    @manishshambu2612 6 років тому

    At 22:01 time... why cant we replace maximum of the left subtree?

    • @haroonkuta
      @haroonkuta 6 років тому

      we can... either maximum of left subtree or minimum in right subtree...

  • @reassume4826
    @reassume4826 6 років тому

    Gem

  • @rajamubeen9374
    @rajamubeen9374 6 років тому +1

    where is the code?????????????/