Amazon interview question

Inverting a binary tree question