Leetcode #226 Invert Binary Tree
This can be solved recursively. Swap nodes and traverse left subtree then right subtree.
Link: Invert Binary Tree
/**
* Definition for a binary tree node.
* function TreeNode(val, left, right) {
* this.val = (val===undefined ? 0 : val)
* ...
michelletanpy.hashnode.dev1 min read