Skip to content

DFS vs BFS

goungoun edited this page Aug 23, 2024 · 9 revisions

Leetcode BFS problem

  1. Average of Levels in Binary Tree
  2. Binary Tree Level Order Traversal
  3. Minimum Genetic Mutation (=shortest path)

BFS Applications

  • Shortest path (no weight)
  • Web crawling
  • Social Networking
  • Garbage collection

MIT Lecture 13: Breadth-First Search (BFS) by Erik Demaine
https://www.youtube.com/watch?v=s-CYnVz-uh4&t=1350s

Clone this wiki locally