You are on page 1of 6

VIDYA VIKAS INSTITUTE OF TECHNOLOGY AND ENGINEERING

File Structures
Module-3

 Topic: Worst Case Search Depth

BY

RAJESH.R
6TH SEM ISE
Worst-Case Search Depth

Worst case occurs when every page of the tree


has only the minimum number of descendants

For a B-tree of order ‘m’, the minimum


number of descendants from the root page is 2

The minimum number of descendants from


intermediate node is [m/2]
The general expression of the relation between depth and the
minimum number of descendants are:-

Levels Minimum descendants

• 1 2

• 2 2 x[m/2]

• 3 2 x[m/2]^2

• 4 2 x[m/2]^3

• d 2 x[m/2]^d-1
The minimum number of descendants at level d is 2 x
[m/2]^d-1

For a tree with N keys in its leaves &min height d


o N>=2 x [m/2]^d-1

If there are N keys at the leaf level, at depth ‘d’ then,

o N>= 2 x [m/2]^d-1

o N/2>= [m/2]^d-1
Example: Worst-Case Search Depth problem

For m=512 and N=1,000,000


Using formula,

 D<=1+log[m/2] (N/2)

 D<=1+log[512/2] (1,000,000)

 D<=1+log[256] (5,00000)

 D<=3.37
So, depth= 3 - levels
Thank You..

You might also like