- Consider a (2,4)-tree that is
maximally populated with entries
(i.e., each internal node
has 3 keys (4 subtrees)
- The largest possible
number of entries stored in a
tree of height h is:
# nodes = 1 + 4 + 42 + 43 + ... + 4h-1
4h - 1
= --------- (Mathematica: Sum[ 4^k, {k,0,(h-1)} ])
3
Max. # keys = 3 * # nodes
= 4h - 1
Therefore:
n ≤ max. value for n (# keys)
≤ 4h - 1
<==> n+1 ≤ 4h
<==> 2log(n+1) ≤ h*log(4)
<==> 2log(n+1) ≤ 2*h
<==> ½ 2log(n+1) ≤ h ........ (1)
|
- Now consider a (2,4)-tree that is
minimally populated with entries
(i.e., each internal node
has 1 keys (2 subtrees)
- The smallest possible
number of entries stored in a
tree of height h is:
# nodes = 1 + 2 + 22 + 23 + ... + 2h-1
= 2h - 1 (Mathematica: Sum[ 2^k, {k,0,(h-1)} ])
Min. # keys = 1 * # nodes
= 2h - 1
Therefore:
n ≥ min. value for n (# keys)
≥ 2h - 1
<==> n+1 ≥ 2h
<==> 2log(n+1) ≥ h*log(2)
<==> 2log(n+1) ≥ h ........ (2)
|
- From Equations (1) and (2),
we conclude that:
2log(n+1)
--------- ≤ h ≤ 2log(n+1)
2
|
Therefore:
|