AVL Tree: Background & Python Code

preview_player
Показать описание
Code below… In this much-requested video we’ll take a look at the AVL tree data structure, which, at the most basic level, is simply a self-balancing Binary Search Tree. As always, in the first half of the video we’ll cover some background (including the main differences between an AVL and BST), and in the second half we’ll open up our coding editor and actually implement an AVL tree class using the Python coding language.

(PYTHON 2)

(PYTHON 3)

****

References:

End song is “Wonder Cycle” by Chris Zabriskie
Рекомендации по теме
Комментарии
Автор

That is hands down the best videos about avl tree I have ever seen..
Especially the repr function to print the tree after every insertion/deletion reinforces the concept of rebalancing..
Great work!!!

idontneedthis
Автор

This is very insightful video, that actually helped me understand how to implement avl tree. Thank you very much for your content!

МаркБачурин-юч
Автор

This video explains better than a 12 page chapter in my book! Thank you!

khailai
Автор

@ 16:03 - It's worth noting that you don't call inspect delete again because the 3rd case does not need to adjust height or rebalance from the original target delete node because it's simply replacing values. But it will traverse and rebalance the tree from the lower node that was used to replace the original target node because that replacement node will never contain two children and will hit cases 1 or 2 which lead to the height+1/rebalance part.

davidporter
Автор

The code you wrote is well commented and easy to understand thanks for that....great work

lalitvavdara
Автор

Great video! Explained a complex concept in a simple and efficient way.
Suggestion: The speech could have been a little louder.
Please make more videos on more topics using python.
Very much appreciate the code being available in both python 2 and 3.

gayathrigirishnair
Автор

Woah! You listened to my request. Thanks a lot, man. Keep making these videos. You're the best. :D

shantanusharma
Автор

Amazing Videos Dude! Something I want to learn ( Heaps, Priority Queues and TRIE). It would be great if you can add any of the above topics.

aspatil
Автор

01:26 caught me offguard lol thanks dude

yiuyiufung
Автор

The amount of methods/functions defined at 14:55 scares me a bit ngl

tyqiangz
Автор

I'm a bit confused with determining the height. My thought of height is that:
"the height of a node is the number of edges on the longest downward path between that node and a leaf."


In the images on 2.45 (1st image) you said the height of the root node is 2 but going of that statement I mentioned above wouldn't it be 1?

philipdimeski
Автор

I got 2 say this is the best AVL tree video many ways. Thanks Brian.
I have a question. How can i make a Fibonacci Tree aka. Worst balanced AVL Tree with 1.44log2(n)? Do I have to make always left rotations?
Would love an answer.


Have a great day and keep you content up. You're smart and have a great way to explain things.

ernestalexanderkasper
Автор

just curious, how would this change if we initialized the self.height to 0 instead of 1 in the Node class?

SarcasticJokerr
Автор

really great video, but would you use letters instead of numerical values for your examples? it really makes it a lot harder to understand, i dont understand why x has a higher value than z. Is it alphabetical?

bubblesgrappling
Автор

Great..can you please also do a video on Depth First and Breadth First Search? Thanks!

AnilYadav-pbhd
Автор

love the explanation, only things missing from these playlists are ques, stacks and hash maps... i know it might seem selfish but can you pls add those as well?

tanmaysharma
Автор

Hey Brian, Thanks for the video. Can you also make videos on Graph Theory covering (BFS, DFS, Dijkstra, Bellman Ford, Floyd Warshall).

PATHAKROHIT
Автор

ur vids are really helpful! amazing explanation it made it feel so easy

bhanupratap
Автор

respected sir...
i really like your videos and content, the way you explain is awesome.
you explain with pseudo code first and write the actual code and compare with other algos and explain big0 notation which is too good. i hardly find any videos similar to your content.
NOTE: YOU EXPLAINS VERY FAST THOUGH GOOD BUT SOMETIMES NOT UNDERSTANDABLE SIR. YOUR CODING SPEED ALSO VERY FAST WHICH IS HARD TO GRASP IT.
THANK YOU SO MUCH FOR YOUR EFFORTS AND KEEP IT UP SIR.

navsiv
Автор

Can you do stacks and queues and tries please??

cookiimonstr