A complete binary tree with n non-leaf nodes contains

2016

A complete binary tree with n non-leaf nodes contains

  1. A.

    log2 n nodes

  2. B.

    n+1 nodes

  3. C.

    2n nodes

  4. D.

    2n+1 nodes

Attempted by 406 students.

Show answer & explanation

Correct answer: D

This question assumes the full binary tree property where every internal node has two children. In such a tree, the number of leaf nodes is always one more than the number of internal (non-leaf) nodes. For n non-leaf nodes, there are n + 1 leaf nodes, resulting in a total of 2n + 1 nodes.

A video solution is available for this question — log in and enroll to watch it.

Explore the full course: Isro