DFS vs BFS
Play this lessonThis lesson comes with an interactive animation you can break, a live-code challenge and a chapter quiz.The web is a directed graph: pages are nodes, hyperlinks are edges. Crawling is graph traversal. DFS is usually a bad choice because the depth can be enormous. Crawlers commonly use BFS with a FIFO queue. But plain BFS has two problems:
The rest of this lesson is part of Pro
Pro unlocks every lesson with its animation, code challenge and quiz, plus every interview problem. ₹299 a month or ₹1,999 a year.
See Pro