Dsa
Trees
Medium
Inverted Binary Tree
Given a binary tree, invert it and return the inverted tree. An inverted tree swaps every left subtree with its corresponding right subtree. For example, the inversion of the tree:
1
/ \
2 3
Becomes:
1
/ \
3 2
Input Format:
A list of integers representing the tree in level order, where -1 indicates a null node.
Output Format:
A list of integers representing the inverted tree in level order.
Key concepts
treetransformationrecursion
Practise this out loud — free
Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.
🎙 Practise this question now