Back
Invert Binary Tree
Given the root of a binary tree, invert the tree, and return its root.
Java
Description
Solution
My Code
Invert Binary Tree
Given the root of a binary tree, invert the tree, and return its root.
Example 1:
Input:
{"root":[4,2,7,1,3,6,9]}
Output:
[4,7,2,9,6,3,1]
Viz
Tests
Run
Input
Example 1
Example 2
Empty
Custom
{"root":[4,2,7,1,3,6,9]}
arr =
{"root":[4,2,7,1,3,6,9]}
4
2
7
1
3
6
9
Variables
No variables to display
Depth
Function Call
Stack empty
0/22
0.5x
1x
2x
4x