added BFS for graph and a strategy to differentiate between BFS and DFS