Goldman Sachs Interview Question

They asked me about graphs and BST