completed BFS and DFS implementation along with testing