Infosys interview question

Graphs