Morgan Stanley Interview Question

Graph,Array and Tree related Problem