- ,
weight Balance
:Overview :
Implementation:(as extended BST)
- Given asetof keys
- splay trees
- Static
X={ Xo ,
. . . ,xn. , }Optimality
Internal node : stores
- and values
- More frequently accessed
key key
→ splitterIvo ,
. . . .vn . , )keys closer to root
float wt
→total j 'D- and weights
⇒ weight
- balanced
weight of
ax xxTv - two ,
. . . . ,wn . , }trees
entries in subtree .- Assume :
1$
. (left
, right-1 .xosx,s
. . .- sxn . ,
External Node :
Wi > o
positivity
key key ,
④
pseudo
- probability
'
iesttiesataedwm
.syoaii.ea.awei.I.iq
- Let:
wi total weight ¥5 Given Yeast ,aBsT
- Let :pi=WiFw
pseudo
- prob
How to ( Nearly) Achieve
is a - balanced if .- Obs:&?; ! ! } }
Shannon 's bound
.for all internal
nodes p . .prob
. → Weight- balanced
balance ( p) sa
distribution
tree
Shannon 's Theorem : Ifpi
is → For each node p :9=42
: Perfectly balancedthe prob
. of accessing Xi ,wtlp) - total weight
=L : Arbitrarily badany Bst has expected search
- f keys nip
{ tathekastfropyipoiflgj!P.in#alledT/balancelpg=maxlwtlp.lettl.wt-p.rightDa--4s :b reasonable
wtlp )
compromise
.-wt
.