Skip to content
TryAlgoViz
Algorithms
Articles
CS Fundamentals
Problems
Roadmap
Dashboard
Theme
Invert Binary Tree — TryAlgoViz
Invert Binary Tree
easy
Visualize
Description
Hints
Discussion
Visual examples
Example 1
Input
1
2
3
4
6
7
9
Output
9
7
6
4
3
2
1
Example 2
Input
1
2
3
Output
3
2
1
Python
Reset
Run
Ctrl+Enter
Loading editor…
Test Case 1
Test Case 2
Input
1
2
3
4
6
7
9
Expected Output
9
7
6
4
3
2
1