A B-tree is of order p and consists of n keys. Its maximum height is —

2018

A B-tree is of order p and consists of n keys. Its maximum height is —

  1. A.

    log(p/2)((n - 1)/2)

  2. B.

    log(p) n

  3. C.

    log⌈p/2 (n - 1)

  4. D.

    None of the above

Attempted by 256 students.

Show answer & explanation

Correct answer: C

The correct answer is: Option 3) log⌈p/2 (n - 1)

Explanation:

The exact maximum height of a B-tree of order p with n keys is derived using the minimum number of children per node, which is ⌈p/2⌉. The precise bound is:

h ≤ log⌈p/2⌉((n + 1)/2)

This comes from the fact that the minimum number of keys grows exponentially with base ⌈p/2⌉.

However, in many competitive exams and standard textbooks, this formula is simplified by ignoring constant factors like +1 and division by 2, since they do not significantly affect logarithmic growth.

Thus, the height is commonly approximated as:

h ≈ log⌈p/2 (n - 1)

Therefore, although Option 3 is a simplified form and not the exact bound, it is accepted as the correct answer in exam context.

Explore the full course: Niacl Ao It Specialist