AVL Tree Explained and Implemented in Java | AVL Trees Rotations | Self-Balancing Trees | Geekific

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

КОМЕНТАРІ • 40

  • @briannadunfield7693
    @briannadunfield7693 2 роки тому +7

    I loved this. The code was super easy to follow and the length of the video was perfect. Thank you for this, it helped me a lot with understanding the implementation.

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

      Thanks a lot! You really made my day :)

  • @jodnova2
    @jodnova2 2 роки тому +7

    Excellent work - thank you for such a clear exposition.

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

      My pleasure! Glad it was helpful :)

    • @lelouch_lamperouge_84
      @lelouch_lamperouge_84 8 місяців тому

      @@geekific
      I wonder which is the proper practice of coding either to respond with a boolean in case of insertion and deletion or to use an approach like yours where we return the actual nodes here and there for ease of writing and readability. Even in the BST video, I've observed this and made my own approach to boolean response but coming to the AVL tree, writing to return booleans may make the code a little complex!
      please suggest to me...

  • @JasonZhang-bi2tv
    @JasonZhang-bi2tv 6 місяців тому

    Can't be more helpful, love the code and the explanation!!!!

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

    Loving your videos. Very informative & easy-to-follow!

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

      Thank you so much! Glad you liked them :)

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

    awesome man _/\_, skiplist and treaps next ?

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

    The code was so clean and detailed with images thnx lot!

  • @rahuldeshpande3516
    @rahuldeshpande3516 9 місяців тому

    hey man! I love the going over of code and demonstration. However, there's a problem. For an AVL tree, you do the rotations within the insertion method. So the tree strycture of 10, having 6, 4, 9 as left children and unbalanced would not even arise (since you'd be balancing/rotating with every insert). So as soon as with the insertion of the third element (4 or 6 or 10) you would have balanced the tree

    • @geekific
      @geekific  9 місяців тому +1

      Well done man! The objective was to explain and relay the idea with an easy example!

    • @rahuldeshpande3516
      @rahuldeshpande3516 9 місяців тому

      no problem @@geekific

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

    Amazing Content !!!

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

      Glad you liked it :)

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

    Great content, love the modular code! It'll be great if you can provide a link to the full code.

    • @geekific
      @geekific  3 роки тому +4

      I am actually working to make everything available on GitHub! However, it takes a bit of time to polish the code discussed in all of the videos and put it together, so I've been waiting for the channel to grow a bit to fully concentrate on this :)
      Anw, if any of the code discussed is not clear please feel free to ask in the comments :D

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

    You are the best! Thank you so much for this video 😍 I finally understand AVL Trees 🤩

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

      Thank you :) Happy to help!

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

    Great video! It helped me a lot to better understand the AVL trees.

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

    11:05 unfortunately you've got the AVL balance in wrong order. It is defined as: b = heightR - heightL; such that if R is higher, b>0 (just like the descending order!) See 11:20
    That means your rotation names in the following code are inverted.
    Yes you could say "it's definition-dependent" but the common definition seems to be that b>0 is right-heavy, b

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

      It is definition dependent xD There are many references out-there that use this approach and I personally think it is a matter of preference. I could include it in the next GitHub update in the source code but I don't think I'll upload another video just for this. Maybe in a future video where I expand on this topic I could mention it, why not! Thank you :)

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

      @@geekific Ok :D
      I've watched more of your videos, great work! Thank you

  • @BearMan-li6be
    @BearMan-li6be 2 роки тому

    Great video, thanks

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

      Glad you liked it!

  • @Kuon_latte
    @Kuon_latte 7 місяців тому

    thanks a lot

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

    Thank u so much

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

      Glad you liked it :)

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

    Do u provide the full code of the programs? That would be helpful

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

      I am actually working on it! However, it takes a bit of time to polish all the code and put it together, so I've been waiting for the channel to grow a bit to fully concentrate on this :)
      Anw, if you have any question or something is not clear, please let me know in the comments :D

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

    What about budding from an array

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

      We might explore that in a future video! Stay Tuned :)

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

    the height of a leaf node is 0 tho, right?

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

      Depends on the definition. At 2:40 we defined it as: "the number of edges from that node to the furthest null node", if you follow this definition then it will be 1. If you replace the word "null" with "leaf" then yeah it is going to be a 0. In this video we went with the first one to have a more straightforward implementation. Cheers!

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

    Don't ever call me a geek

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

      Why not? :( That's its Google definition:
      1- Engage in or discuss computer-related tasks obsessively, with great attention to technical detail.
      2- Be or become extremely excited or enthusiastic about a subject.

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

      @@geekific lol I'm just goofing around. I appreciate your videos 👍🏾

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

      Then what is a Nerd @@geekific ?