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

  Рет қаралды 36,312

Geekific

Geekific

Күн бұрын

Пікірлер: 40
@briannadunfield7693
@briannadunfield7693 2 жыл бұрын
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 :)
@JasonZhang-bi2tv
@JasonZhang-bi2tv 8 ай бұрын
Can't be more helpful, love the code and the explanation!!!!
@jodnova2
@jodnova2 2 жыл бұрын
Excellent work - thank you for such a clear exposition.
@geekific
@geekific 2 жыл бұрын
My pleasure! Glad it was helpful :)
@lelouch_lamperouge_84
@lelouch_lamperouge_84 10 ай бұрын
@@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...
@SatchelHamilton
@SatchelHamilton 3 жыл бұрын
Loving your videos. Very informative & easy-to-follow!
@geekific
@geekific 3 жыл бұрын
Thank you so much! Glad you liked them :)
@omergrn5985
@omergrn5985 3 жыл бұрын
The code was so clean and detailed with images thnx lot!
@geekific
@geekific 2 жыл бұрын
Glad it helped!
@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.
@geekific
@geekific 3 жыл бұрын
Glad it helped!
@samarthtandale9121
@samarthtandale9121 2 жыл бұрын
Amazing Content !!!
@geekific
@geekific 2 жыл бұрын
Glad you liked it :)
@amol_
@amol_ 3 ай бұрын
awesome man _/\_, skiplist and treaps next ?
@rahuldeshpande3516
@rahuldeshpande3516 10 ай бұрын
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 10 ай бұрын
Well done man! The objective was to explain and relay the idea with an easy example!
@rahuldeshpande3516
@rahuldeshpande3516 10 ай бұрын
no problem @@geekific
@crystalcuthinho5990
@crystalcuthinho5990 3 жыл бұрын
Great content, love the modular code! It'll be great if you can provide a link to the full code.
@geekific
@geekific 3 жыл бұрын
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
@BearMan-li6be
@BearMan-li6be 2 жыл бұрын
Great video, thanks
@geekific
@geekific 2 жыл бұрын
Glad you liked it!
@Kuon_latte
@Kuon_latte 8 ай бұрын
thanks a lot
@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 жыл бұрын
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
@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 жыл бұрын
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 жыл бұрын
Don't ever call me a geek
@geekific
@geekific 2 жыл бұрын
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 жыл бұрын
@@geekific lol I'm just goofing around. I appreciate your videos 👍🏾
@samarthtandale9121
@samarthtandale9121 11 ай бұрын
Then what is a Nerd @@geekific ?
From Small To Giant 0%🍫 VS 100%🍫 #katebrush #shorts #gummy
00:19
If people acted like cats 🙀😹 LeoNata family #shorts
00:22
LeoNata Family
Рет қаралды 23 МЛН
The IMPOSSIBLE Puzzle..
00:55
Stokes Twins
Рет қаралды 182 МЛН
Understanding B-Trees: The Data Structure Behind Modern Databases
12:39
AVL Trees & Rotations (Self-Balancing Binary Search Trees)
20:38
Back To Back SWE
Рет қаралды 352 М.
10.1 AVL Tree - Insertion and Rotations
43:08
Abdul Bari
Рет қаралды 1,2 МЛН
Lecture 6: AVL Trees, AVL Sort
51:59
MIT OpenCourseWare
Рет қаралды 671 М.
Balanced binary search tree rotations
8:51
WilliamFiset
Рет қаралды 174 М.
Premature Optimization
12:39
CodeAesthetic
Рет қаралды 835 М.