Consider a binary tree 𝑇 in which every node has either zero or two children.…

GATE Β· 2025 Β· CS Β· Set 2 Β· Computer Science & IT

Consider a binary tree 𝑇 in which every node has either zero or two children. Let 𝑛 > 0 be the number of nodes in 𝑇.

Which ONE of the following is the number of nodes in 𝑇 that have exactly two children?

  1. A.

    nβˆ’22\frac{n - 2}{2}

  2. B.

    nβˆ’12\frac{n - 1}{2}

  3. C.

    n2\frac{n }{2}

  4. D.

    n+12\frac{n + 1}{2}

Attempted by 406 students.

Sign up free to check your answer

Sign up free

Explore the full course: Data Structures

Loading lesson…