Following are the differences between BFS and DFS graph algorithms:
BFS
DFS
Uses queue for traversing
Uses stack for traversing;
Requires a lot of memory
Requires O(depth) memory
It finds one of the nearest solution first
Most likely the nearest solution will not find first
Works on infinite trees
Not usable on infinite trees
Comments
Post a Comment