Infosys Interview Question

asked about depth first search