Bird
Raised Fist0

Given the final inverted tree where the root's left child is 7 and right child is 2, and the left subtree's left child is 9, what was the original root's left child?

hard🔄 Reverse Engineer Q9 of Q15
Tree: Depth-First Search - Invert Binary Tree
Given the final inverted tree where the root's left child is 7 and right child is 2, and the left subtree's left child is 9, what was the original root's left child?
A7
B9
C2
D6
Step-by-Step Solution
Solution:
  1. Step 1: Understand inversion effect

    Inversion swaps left and right children at every node.
  2. Step 2: Reverse swap at root

    Final left child is original right child, so original left child is final right child, which is 2.
  3. Final Answer:

    Option C -> Option C
  4. Quick Check:

    Invert swaps children -> original left = final right [OK]
Quick Trick: Invert swaps children; reverse to find original [OK]
Common Mistakes:
MISTAKES
  • Confusing final left with original left
  • Not reversing inversion logic
Trap Explanation:
PITFALL
  • Candidates often fail to reverse the inversion logic to find original structure.
Interviewer Note:
CONTEXT
  • Tests ability to reason backwards through tree inversion
Master "Invert Binary Tree" in Tree: Depth-First Search

3 interactive learning modes - each teaches the same concept differently

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Tree: Depth-First Search Quizzes