smallcase Interview Question

difference in tree and graph