Amazon interview question

Reverse a tree in any coding language