 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
| |
Time
for insert or get is proportional to trees height
|
|
|
| |
Let N
be the number of nodes, n be the number of items, and h
|
|
|
be
the height
|
|
|
| |
Define
h so that a tree consisting of a single node is height 0
|
|
|
| |
Its easy to see 1+2+4+
+2h £ N £
1+4+16+
+4h
|
|
|
|
|
| |
Its
also easy to see N £ n £ 3N
|
|
|
| |
Using the above, we have n ³ 1+2+4+
+2h =
2h+1-1
|
|
|
|
|
| |
Rewriting,
we have h £ log(n+1) - 1 or h = O(log n)
|
|
|
| |
Thus,
Dictionary operations on 234-trees take time O(log n) in
|
|
|
|
the
worst case
|
|