Advantages of Breadth First Search:
- Used to find the shortest path between vertices
- Always finds optimal solutions.
- There is nothing like useless path in BFS,since it searches level by level.
- Finds the closest goal in less time
Disadvantages of BFS:
- All of the connected vertices must be stored in memory. So consumes more memory
Advantages of Depth First Search:
- Consumes less memory
- Finds the larger distant element(from source vertex) in less time.
Disadvantages of BFS:
- May not find optimal solution to the problem.
- May get trapped in searching useless path.