GATE CS 2025 · Set 2 · Trees

MCQ · 1 mark · Problem PROG-DSTR-0063

Consider a binary tree \(T\) in which every node has either zero or two children. Let \(n > 0\) be the number of nodes in \(T\). Which ONE of the following is the number of nodes in \(T\) that have exactly two children?
  1. A
    \(\frac{n -2}{2}\)
  2. B
    \(\frac{n - 1}{2}\)
  3. C
    \(\frac{n}{2}\)
  4. D
    \(\frac{n + 1}{2}\)

Solve it on GATE DA practice →More Basic Data Structures problems

Show the worked solutionOfficial GATE Answer Key: Option B.See full step-by-step discussion on GateOverflow: https://gateoverflow.in/460832/gate-cse-2025-set-2-question-3

GATE DA practice: past exam problems by chapter, with worked solutions · gatedaprep.com