SLB Interview Question

Write code for DFS and BFS