Binary Search Tree Removal

Поделиться
HTML-код
  • Опубликовано: 7 янв 2025

Комментарии • 50

  • @Csartreweghhgf
    @Csartreweghhgf 5 лет назад +24

    This is by far one the best resource about Data Structure out there

  • @mia-so4ry
    @mia-so4ry 3 года назад +16

    This is amazing, i procrastinated so much bc i was afraid of not understanding this concept but you just solved my problem and gave me motivation again THANK YOU!

  • @milan8284
    @milan8284 2 года назад +8

    I have a data structures and algorithms exam tomorrow. I'm currently using your videos to study. Great resource 💯💯💯

  • @mattp6460
    @mattp6460 4 месяца назад

    your explanations of algorithms without actually giving explicit algorithms are really helpful thanks

  • @ghostfjdgcsusvsgsj
    @ghostfjdgcsusvsgsj Год назад +2

    this is the best BST removal tutorial I've seen so far!

  • @iaa6662
    @iaa6662 5 лет назад +3

    The king of Data Structure

  • @beepIL
    @beepIL 3 года назад +3

    I can't believe there are so many paid materials out there that do not even come close to how clear your videos are...

  • @shubhammantri3550
    @shubhammantri3550 5 лет назад +1

    You are the best. The way the explain is far better than my university professor.

  • @fahdcoding8701
    @fahdcoding8701 3 года назад +1

    Great explanation! Out of all the videos I’ve watched this is the one which clicked perfect with me.

  • @bingxie342
    @bingxie342 5 лет назад +5

    Just want to say thank you, this channel is so good!!!!!!

  • @Lexyvil
    @Lexyvil 2 года назад +1

    Phenomenal explanation and demonstration, with great examples! This was a perfect refresher while preparing for my final exam. Thank you.

  • @jainam7
    @jainam7 8 месяцев назад +1

    wonderful explanation, kudos to your efforts!

  • @散华-l9m
    @散华-l9m Год назад

    Clear explanation and easy to understand

  • @kilahuy
    @kilahuy 7 лет назад +9

    Very helpful!

  • @pokerface550
    @pokerface550 5 лет назад

    10:14 - I think it can be only cases I and II since in cases III and IV a left subrtee or both of the subtrees exist, and in such a case we would go further left-down searching for the smallest element untill we come across cases I or II. Isn't it right?

    • @ahmedhussein6359
      @ahmedhussein6359 2 года назад

      compare the picture at 4:04 with the pic at 10:14 brother....you will understand the latter....you are right in the sense that there will never be a case where a node has 2 children, ie case iV....but there cane definitely be cases where a node has 1 child, but the youtuber has categorized both case ii and case iii as cases with one child....thats the confusion....

  • @navyasingh5416
    @navyasingh5416 4 года назад +1

    Best Explanation Ever!!

  • @zain6842
    @zain6842 3 года назад

    Thank you so much! You made the whole concept so easy to understand)

  • @mudabirp758
    @mudabirp758 Год назад

    Thanks!

  • @jakoon_the_manic
    @jakoon_the_manic Год назад

    Hey, just in general thanks for the videos man, helping me out with my course work

  • @Study-ph6pf
    @Study-ph6pf 2 года назад

    Very well explained! Thank you so much, I really appreciate it ♥!

  • @ledtargaouschi5831
    @ledtargaouschi5831 Год назад

    Perfect explanation !

  • @pradyumnbisht4077
    @pradyumnbisht4077 4 года назад

    Sir i have a question, when finding successor in 4th case, can we also do like - making 20 the successor and just simply the 5 will point to 11 as its parent. So basically the whole left part of the tree is shifted down to 11 as its parent node.

  • @shayaksarkar7740
    @shayaksarkar7740 4 года назад +1

    I just wantedi to ask that would'nt it be better if instead of copying the values, we somehow found a way to readjust the pointers. Because, it might be possible that I'll be pointing to that particular node elsewhere in my code. If in the removal phase, the value of that node gets tampered without my knowledge, it would be a mess, would'nt it ??

    • @rustycherkas8229
      @rustycherkas8229 2 года назад +1

      If you are concerned that data at that "saved pointer elsewhere" may be invalidated, then do not save any pointers. It's a variation on "race conditions".
      I see an empty table in a "food hall", so I go order a burger. Later, when I have my burger, that table is no longer empty... Ain't life a bitch!
      It would be a mess, too, if your "saved pointer" happens to be the one deleted by intervening operations.

    • @shayaksarkar7740
      @shayaksarkar7740 2 года назад

      @@rustycherkas8229 So what you are trying to say through this huge para is copying the values is a better decision while making BSTs instead of readjusting the pointers. According to me, while deigning the BST we should not make assumptions on how its going to be used. Just design in a way we feel the system is more robust.

    • @rustycherkas8229
      @rustycherkas8229 2 года назад +1

      @@shayaksarkar7740 If you retain pointers to nodes in multiple places, then you have multiple locii of control. A (balanced) BST works because the caller of insert() allows insert() to change which node is the root node to maintain balance. Deleting nodes can/will cause the tree to become very "unbalanced" so that even find() and insert() perform badly A "binary search tree" can decay into a simple linked list...
      "robust"? Then you want to "lock" the tree to prevent changes so that your tree cannot be altered while your "code somewhere else" retains control of its node... Good luck with that!
      It's a dynamic world. Live with it.

    • @shayaksarkar7740
      @shayaksarkar7740 2 года назад

      @@rustycherkas8229 Again ... You don't seem to make 1 point that suggests re-arranging the nodes themselves is not better than copying values. Maybe the users of the BST want to keep references to the nodes. Maybe that is what suits their design needs.
      "A (balanced) BST works because the caller of insert() allows insert() to change which node is the root node to maintain balance" - Okay, so what? Doesn't mean it gives permission to the nodes to change their values.
      If the users are using locking, let them do so. Intelligent of them. Still I don't get your point.

    • @rustycherkas8229
      @rustycherkas8229 2 года назад

      ​@@shayaksarkar7740 Try this:
      Your concern seems to be that the memory storing a node will be changed by 'copying' content from another node over top of it.
      "Code somewhere else" may be affected (expecting the content to be unchanging.)
      The operation is 'delete'... the memory containing a deleted node (or the 'source node' of the copy operation) will be released or recycled. Subsequent access by "code somewhere else" will cause undefined behaviour.
      The expectation of "code somewhere else" is flawed.
      Delete will cause 1 node to be released/recycled... Bad luck if "code somewhere else" has a long-term interest in ANY node & its content...
      Who "gives permission" for "code somewhere else" to expect nodes of a BST to remain unchanged (when deletion is available.)...
      'Better' is in the eyes of the beholder...

  • @lebenebou
    @lebenebou 2 года назад +1

    wa7esh we7yet emme

  • @Tough802Peter
    @Tough802Peter 2 года назад

    tfuck, how? how can this guy be so genius!!! Love your content

  • @michaelphelps7284
    @michaelphelps7284 3 года назад

    Great video. Earned a subscriber

  • @anton1492
    @anton1492 2 года назад

    perfect explanation. tnx a lot!

  • @kartikbhartiya1799
    @kartikbhartiya1799 6 лет назад

    This is really very heplful! thanks

  • @hobobmo
    @hobobmo 4 года назад +1

    Great video!

  • @vigneshsr1118
    @vigneshsr1118 4 года назад

    Just wanted to say thank you :)

  • @MuazAtik
    @MuazAtik Год назад

    Thank you 👏🙏🙏

  • @iamcasted
    @iamcasted 2 года назад

    You are a legend

  • @vitoanania6042
    @vitoanania6042 Год назад

    awesome video.

  • @reassume4826
    @reassume4826 4 года назад +1

    Thanks Sir.

  • @hillstudios1
    @hillstudios1 3 года назад

    How can I repay you William.Thank you.I hope you are fine

  • @readymade_workshop
    @readymade_workshop 3 года назад

    Thank you so much!

  • @anonimanonim1223
    @anonimanonim1223 2 года назад

    THANK FOR THIS VIDEO,!!!!!!!!!!!!!

  • @_inetuser
    @_inetuser 2 года назад

    best one

  • @sachinjain6913
    @sachinjain6913 10 месяцев назад +1

    BESTT