The Dodo interview question

Rebalance a binary search tree