Completed depth first seach and breadth first search.