AVL 1 Introduction

preview_player
Показать описание
Dr. Rob Edwards from San Diego State University introduces AVL trees and discusses how to balance them
Рекомендации по теме
Комментарии
Автор

As someone mentioned below, the last example is incorrect. But when we think about why, or how it should be done, we shouldn't start at the top and go down. We should think recursively, based on how node insertion works. Node insertion starts at the top of the tree and recursively descends until it finds the place to add the new node. Then, after adding the node, we unwind the recursion, returning back up the tree, updating the height as we go, checking each time whether the tree is unbalanced. In the example the tree is not unbalanced until we get back up to the root node, 4. That's why the (double) rotation should be centered on 4 (right on 10 and then left on 4, as mentioned below).

fredonianewmancenter
Автор

I wish I had Teatchers like him in my university.

BloodHaZaRd
Автор

5:36 - What he means is he has a height of 3 children on the right of the four. This is why AVL trees call them 'heights' and not 'children', because it can be very confusing otherwise. Here, the four seems to have 4 children, but what the teacher means is that the height of its children is 3.

jakethewoz
Автор

This is the best explaination of avl trees, I have ever heard. Thank you for being so clear and concise.

oliverdo
Автор

Best explanation i've come across so far. Brilliant and simple. Wonderful vid! Thank you so much for this!

fredericoamigo
Автор

@RobEdwardsSDSU
, there are several mistakes
1. Minor, there are number 8 written as 6.
2. Major - you are rotating wrong numbers near 6:00. You should rotate right and get 8 parent of 10 and 10 parent of 9 and 12 ( 9/10\12 ) and then rotate left and make 8 root.

slitynskyy
Автор

this guy is insane the way it was explained it made so much sense

glowstonedust
Автор

how come first time 9 is considered to be the violating node and not 8.
And later after left right, 10 is considered the violating node and not 12.
How do we select the violating node ?

jalajkhanna
Автор

This was exactly the instruction that I needed to understand height better, and to understand rotations. Thank you.

TheElof
Автор

Breaks down the problem properly. Love it

sikhokhelekhohliso
Автор

Thanks a bunch. The best explanation ever.

freshbreeze
Автор

Thanks very much Dr. Rob, extremely well articulated information! Love the analogies. Home-wrecking single parents lol

returnMarcco
Автор

Are you writing in mirror image? If so, that is impressive.

iamhaileyrene
Автор

awesome explaination. ..but how is he writing those letters on glass.

sujaysshenoy
Автор

at 5:53 ... why isn't the root the violation? can't you just do one rotation of the root to its left child from the start to fix it?

EricSmith-tspj
Автор

You are doing awesome lectures! Thanks so much!

KansasFashion
Автор

Excellent video, helped me so much. Thanks!

惜小夜
Автор

who cares about the trees
that dude is writing like backwards, teach me that instead

georgevasiliadis
Автор

Thank you so much! Your videos on avl trees are great!

heikeneubau
Автор

Great videos. Balancing makes a lot more sense, now.

mezzamate