91. invert a binary tree

JavaScriptAlgorithm
Is this helpful ?

easy  - accepted / - tried

Can you invert a binary tree and get an offer from Google?

Inverting a node means swapping its left child and right child. You need to apply this to all nodes. As following figure illustrates.

Let's try to solve this problem within 10 mintues.

Discuss(37)