Uber Interview Question

Binary search tree related question