Qualcomm Interview Question

I vaguely remembered, swapping a binary tree.