Morgan Stanley Interview Question

Binary search tree, prime numbers