Balance factor :
Er AVL Height Balance
BSTNoderotateRightlpstnodepyballvt-hg.tl
- v. right)
- hgtlv
- for each node v.the heights
Dstnodeg =p
. left3
"
auotitsesisbtrieeasrdisewarbsss.%:÷pn
tree that satisfies this return g
④ ④
⑥
- ⑨
condition
1
."
A
Tree
④
itowto maintain them property ?
'AULT
I
⑤
- oestnwimboaosmeeis.?÷÷÷÷÷÷÷÷i7n&
"
"
% .
Worst cases :
⑧E
rotation ⑥ µ,
height:h= ? %
,
guard
Acb seeds E
Acbscicdst
nodes
:n=
,z
y z
iz 20
. . .Theorem : An AVL tree of
§
.nil
- z
3
5
8
13 21
: . .height h has atleast Feng
- I J
Recall
:Fo - 0,5=1 , Faster .,tFa,
nodes
.hmm
corollary
:An AVL tree with
n nodes
conjecture
:Min
no
, of nodesin AVL Proof :(Induct
. ohh )has height Ollogn )
tree of height his
ten ,
- I
h=0 nth)=1=F
, -1
Proof :
Fact : Faa 9455 where
h=l
" :n(h7=2=Fy
- I
y
.- firs)/z
Golden ratio
"nm
:÷i÷:::÷÷,
n÷e÷
.
loan .
' n ,,
' Khaitan)-1=1%51
A
= Ollogn )D
\ /