depth first search and breadth first search