Translate

Visit to www.mrmcse.com

10 March 2018

Write down the advantage and disadvantage of BFS and DFS traversal algorithm




The advantage of BFS:

(i) Solution will definitely found out by BFS if there are some solutions.

(ii) BFS will never get trapped in blind alley, means unwanted nodes.

(iii) If there is more than one solution then it will find solution with minimal steps.


Disadvantages of BFS:

(i) Memory constraints as it store all the nodes of present level to go for next level.

(ii) If solution is far away then it consumes time.



The advantage of DFS:

(i) Memory requirement is linear WRT nodes.

(ii) Less time and space complexity rather than BFS.

(iii) Solution can be found out by without much more search.



Disadvantage of DFS:

(i) Not guaranteed that it will give a solution.

(ii) Cut-off depth is smaller so time complexity is more?

(iii) Determination of depth until the search has proceeds.





No comments:

Post a Comment