Bose Interview Question

How to do BFS and DFS?