Created general bfs and dfs inside Graph interface