BFS is extremely useful. You may not imagine.

Here we try to compile a list of inspiring BFS problems.

- BFS in string: Letter Case Permutation
- Distance with power: Cheapest Flights Within K Stops
- Revisit seen nodes: Knight Probability in Chessboard
- BFS with heap: Movie Network
- For seen set use array, instead of a set: Is Graph Bipartite
- Scan from target to original: Reach a Number
- BFS with memorization: Target Sum

See all bfs problems: #bfs

- Review: BFS Problems
- LintCode: Social Network
- LintCode: Police Distance
- Lintcode: Movie Network
- LintCode: Maximum Association Set
- LintCode: Island City
- LintCode: Frog Jump
- LintCode: Deliver The Message
- Leetcode: Word Ladder II
- Leetcode: Word Ladder
- Leetcode: Walls and Gates
- Leetcode: Trapping Rain Water II
- Leetcode: The Maze
- Leetcode: Target Sum
- Leetcode: Sliding Puzzle
- Leetcode: Similar String Groups
- Leetcode: Shortest Distance to a Character
- Leetcode: Shortest Distance from All Buildings
- Leetcode: Shortest Bridge
- Leetcode: Rotting Oranges
- Leetcode: Remove Invalid Parentheses
- Leetcode: Push Dominoes
- Leetcode: Print Binary Tree
- Leetcode: Open the Lock
- Leetcode: Network Delay Time
- Leetcode: N-ary Tree Level Order Traversal
- Leetcode: Minimum Height Trees
- Leetcode: Minimum Genetic Mutation
- Leetcode: Maximum Depth of N-ary Tree
- Leetcode: Matrix Cells in Distance Order
- Leetcode: Letter Case Permutation
- Leetcode: Knight Probability in Chessboard
- Leetcode: Keys and Rooms
- Leetcode: Is Graph Bipartite?
- Leetcode: Graph Valid Tree
- Leetcode: Generalized Abbreviation
- Leetcode: Find Bottom Left Tree Value
- Leetcode: Employee Importance
- Leetcode: Directed Graph Loop
- Leetcode: Cousins in Binary Tree
- Leetcode: Coin Change
- Leetcode: Closest Leaf in a Binary Tree
- Leetcode: Cheapest Flights Within K Stops
- Leetcode: Champagne Tower
- Leetcode: Bus Routes
- Leetcode: Binary Tree Zigzag Level Order Traversal
- Leetcode: Binary Tree Right Side View
- Leetcode: Binary Tree Level Order Traversal II
- Leetcode: Binary Tree Level Order Traversal
- Leetcode: Average of Levels in Binary Tree
- Leetcode: All Nodes Distance K in Binary Tree
- Leetcode: 01 Matrix

See more blog_posts.

Share It, If You Like It.