Domanda di colloquio di Infosys

Coding question on heap and graph.