AVL tree insertion

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

КОМЕНТАРІ • 32

  • @basix250
    @basix250 3 роки тому +21

    Your data structure videos are the best resources I've ever encountered. Thank you for awesome tutorials!

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

      +1. Clean concise code. Clear concise explanations. Thank you!

  • @akhilrajnambiar2080
    @akhilrajnambiar2080 3 роки тому +3

    This is by far the best explanation for AVL Trees pseudocode, I could find on the internet! Really awesome content.

  • @phanthanhchung7273
    @phanthanhchung7273 Рік тому

    Your explanation is top-notch, I'm not even kidding.

  • @ghostfjdgcsusvsgsj
    @ghostfjdgcsusvsgsj Рік тому

    this is the best DS tutorials hands down!

  • @adnansamivlogs7789
    @adnansamivlogs7789 Рік тому

    Amazing explanation! I wish my university professors could teach like you. Life would’ve been so much easier. Thank you so much for making these videos, it’s really helping me in my algorithms course.

  • @arkadyzelensky7655
    @arkadyzelensky7655 2 роки тому +2

    Thank you very much! You did amazing job!
    I watched others video and didn't understand AVL tree, but yours did the trick :)

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

    if you write this code exactly, your balance function might not work. to fix that, add an update function in the insert function for the node as soon as you create it before returning. This is very important as the height and bf of the subsequent subtrees depend on the leaf nodes

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

    Best explanation for AVL tree on youtube!.

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

    At 7:32, why is the condition to test if a rotation is "leftleft" or "leftright" node.left.bf

  • @howardcheng9293
    @howardcheng9293 5 років тому +3

    The best explanations I have ever searched, thanks a lot ^_^
    Your tree rotation video is awesome and easy to understand too, very helpful for me!

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

    You are much better than my professor.. Thanks!

  • @kristijanceple6026
    @kristijanceple6026 4 роки тому +2

    Genius! Simplicity and effectiveness themselves! liked and subbed

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

    7:11 wrong code...please edit video....

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

    The connecting lines of the trees need to be thicker. They are almost invisible.

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

    Amazing explanation. The breakdown of what's happening makes it look so simple. Thanks :)

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

    ​ @WilliamFiset Man you are a amazing. hero! Superman!

  • @osolomons
    @osolomons 6 років тому +12

    5:23 "pseudo-code" == almost python

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

    Is the code examples in C+?

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

    Man you're being awesome! Thanks for that... Keep that up! :)

  • @NaveenKumar-os8dv
    @NaveenKumar-os8dv 2 роки тому

    Looking at the comments, I think I am just dumb for not understanding it. I don't understand the part after the rotation. When rotation is done, and we have new root at the top, how do we connect to the parent? how does it happen, don't skip that part please. because parent still has reference to the rotated node.

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

    Very good explanations! Keep'em coming :)

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

    After rotating, the balanced factor of the root node is 0(+1) for the left-left case. Why including +1? Thanks

    • @WilliamFiset-videos
      @WilliamFiset-videos  7 років тому

      Lifeng W I'm pretty sure the reason is that the immediate left node before rotation might have a right child. When the rotation happens that node appears on the other side resulting in a +1.

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

      The immediate left node(4) before rotation has right child(C), but C is already in the balanced tree whose bf is 0. Right?

    • @WilliamFiset-videos
      @WilliamFiset-videos  7 років тому +1

      We're talking about the same node. However, a node is considered 'balanced' if its balance factor is -1, 0 or +1. The only time we have to rebalance a node is when the BF is either +2 or -2. This is why after the rotation the balance factor of the root is allowed to be 0 or +1 in a left -left a rotation.

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

    These are amazing thank you!

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

    dayuym, this some crazy shi , thanks

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

    You r awesome 😎

  • @georgen.d8557
    @georgen.d8557 10 місяців тому

    the most unseful youtube video on youtube dislike because the tree is on balans already