logo
Problems

Invert Binary Tree

Problem

Invert a binary tree.

Example

      1         1
     / \       / \
    2   3  => 3   2
       /       \
      4         4

Challenge

Do it in recursion is acceptable, can you do it without recursion?

Online Judge