Microsoft interview question

Binary search tree algorithm optimisation