Computer Science EngineeringModerate

The height (in edges) of a complete binary tree having n nodes is

  1. A. ceil(log2 n)
  2. B. n/2
  3. C. floor(log2 n)
  4. D. n-1

Correct answer: C. floor(log2 n)

A complete binary tree fills levels in order, so its height is floor(log2 n).

More Algorithms, Data Structures & Programming (ISRO CS) questions

Exams that ask this topic