A Breadth-first search (BFS) is an algorithm for traversing or searching tree or graph data structures. It starts at the tree root (or some arbitrary node of a graph, sometimes referred to as a ‘search key’) and explores the neighbor nodes first, before moving to the next level neighbors.

Below image shows order in which the nodes are expanded in BFS –

In this post, we have list out commonly asked interview questions that can be solved using BFS –

- Breadth First Search (BFS) | Iterative & Recursive Implementation

- Minimum number of throws required to win Snake and Ladder game

- Determine if given graph is Bipartite Graph or not

- Check if an undirected graph contains cycle or not

- Chess Knight Problem | Find Shortest path from source to destination

- Shortest path in a Maze | Lee algorithm

- Find shortest safe route in a field with sensors present

- Flood Fill Algorithm

- Count the number of islands

- Find Shortest path from source to destination in a matrix that satisfies given constraints

- Least Cost Path in Weighted Digraph using BFS

- Find maximum cost path in graph from given source to destination

- Least cost path in given digraph from given source to destination having exactly m edges

- Traverse the given directory using BFS and DFS in Java

- Find shortest distance of every cell from landmine in a Maze

- Check if given binary tree is complete binary tree or not

- Level Order Traversal of Binary Tree

- Total number of paths in given digraph from given source to destination having exactly m edges

**Thank you for being with us. ðŸ™‚**

## Leave a Reply