Leetcode: Reverse Odd Levels of Binary Tree
A practice problem for a level-order traversal of a tree
root of a perfect binary tree, reverse the node values at each odd level of the tree.
- For example, suppose the node values at level 3 are
[2,1,3,4,7,11,29,18], then it should become
Return the root of the reversed tree.
A binary tree is perfect if all parent nodes have two children and all leaves are on the same level.