Question:

How many null links does an arbitrary binary tree with $n$ nodes have?

Show Hint

Always remember: a tree with $n$ nodes has $n-1$ edges. In a binary tree, subtract these from the total $2n$ child pointers to find the number of null links.
Updated On: Jul 6, 2026
  • $n+1$
  • $2n$
  • $2n-1$
  • $n-1$
Show Solution
collegedunia
Verified By Collegedunia

The Correct Option is A

Approach Solution - 1

Step 1: Understanding binary tree links.
In a binary tree, each node has exactly two child pointers: one left child pointer and one right child pointer. Therefore, for a tree with $n$ nodes, the total number of child pointers is $2n$.
Step 2: Counting non-null links.
In any tree with $n$ nodes, there are exactly $n-1$ edges (links connecting parent and child nodes). These edges correspond to the non-null child pointers in the binary tree.
Step 3: Calculating null links.
Out of the total $2n$ child pointers, $n-1$ are non-null. Hence, the number of null links is: \[ 2n - (n-1) = n+1 \]
Step 4: Final conclusion.
Thus, an arbitrary binary tree with $n$ nodes contains exactly $n+1$ null links.
Was this answer helpful?
0
0
Show Solution
collegedunia
Verified By Collegedunia

Approach Solution -2

Another way to confirm this is to count null links directly for small example trees and check which formula matches, rather than deriving the count algebraically from total pointers and edges.

  1. Case n = 1 (a single node, no children): Both its left and right child pointers are null, giving 2 null links. Checking option A, n+1 gives 1+1=2, matching exactly.
  2. Case n = 2 (root with one child, say a left child only): The root has a null right pointer (1 null link), and the single child (a leaf) has both its left and right pointers null (2 null links), giving 1+2=3 null links in total. Checking option A, n+1 gives 2+1=3, matching exactly again.
  3. Case n = 3 (root with two children, both leaves): The root has both pointers filled (0 null links from the root), and each of the two leaf children has both pointers null (2 null links each), giving 2+2=4 null links in total. Checking option A, n+1 gives 3+1=4, matching once more.

Now checking the other options against these same three cases (for n=1,2,3, the true null-link counts are 2, 3, 4 respectively): 2n gives 2, 4, 6 (fails for n=2,3); 2n-1 gives 1, 3, 5 (fails for n=1,3); n-1 gives 0, 1, 2 (fails for all three cases). Only n+1 matches the actual count in every case tested.

Therefore, the correct answer is n+1.

Was this answer helpful?
0
0