Reverse alternate levels of a perfect binary tree
Given a complete binary tree, reverse the nodes present at alternate levels.
- Time : O(n)
- Space : O(n)
1 | void reverseAlternate(Node *root) |
Reverse alternate levels of a perfect binary tree
Given a complete binary tree, reverse the nodes present at alternate levels.
1 | void reverseAlternate(Node *root) |