J.P. Morgan interview question

How to reverse a tree