Given a complete binary tree has all possible leaves at level 8 (root at level…

2019

Given a complete binary tree has all possible leaves at level 8 (root at level 0), how many leaves are there?

  1. A.

    128

  2. B.

    256

  3. C.

    512

  4. D.

    1024

Attempted by 56 students.

Show answer & explanation

Correct answer: B

With root at level 0, level 8 of a complete binary tree has 2^8 leaves when all possible leaves are present. Thus the number of leaves is 256.

Explore the full course: Coding For Placement