Qualcomm interview question

I vaguely remembered, swapping a binary tree.