Question

Please clearly explain what are the differences between DFS (Depth First Search)  and BFS (Breadth First Search)?

Please clearly explain what are the differences between DFS (Depth First Search)  and BFS (Breadth First Search)?

0 0
Add a comment Improve this question Transcribed image text
Answer #1

BFS

DFS

BFS Stands for “Breadth First Search”. DFS stands for “Depth First Search”.
BFS use queue data structure DFS use stack data structure
Breadth First Search can be done with the help of queue i.e. FIFO implementation. Depth First Search can be done with the help of Stack i.e. LIFO implementations.
BFS visit nodes level by level in Graph. DFS visit nodes of graph depth wise. It visits nodes until reach a leaf or a node which doesn’t have non-visited nodes.
BFS is slower than DFS. DFS is more faster than BFS.
Add a comment
Know the answer?
Add Answer to:
Please clearly explain what are the differences between DFS (Depth First Search)  and BFS (Breadth First Search)?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT