Completed depth first search and breadth first search with tests.