Siemens Interview Question

Dfs algorithm