Rakuten Interview Question

Related to Binary search tree