91. invert a binary tree

JavaScriptAlgorithm

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.

Think about the edge cases.

(98)