Question d’entretien chez Apple

I was asked to invert a binary tree.