Given the root of a perfect binary tree, reverse the node values at each odd level of the tree.
The level of a node is defined as the number of edges on the path from the root to that node, where the root is at level
Return the root of the reversed tree.
Constraints:
The number of nodes in the tree is in the range
Node.val
root is a perfect binary tree.
Given the root of a perfect binary tree, reverse the node values at each odd level of the tree.
The level of a node is defined as the number of edges on the path from the root to that node, where the root is at level
Return the root of the reversed tree.
Constraints:
The number of nodes in the tree is in the range
Node.val
root is a perfect binary tree.