The difference between BFS that is breadth-first search and DFS that is depth-first search is that breadth-first search is graph traversing method that uses a queue for storing visited vertices, whereas depth-first search is graph traversing method that uses the stack for storing visited vertices.

Breath first search and depth-first search are one of the most important concepts in computer programming. Depth-first search follows a path from start to end that is end node on the other hand bread first search work level by level. If we talk about the main difference, then the main difference between BFS that is breadth first search and DFS that is depth-first search is that breadth first search is graph traversing method that uses a queue for storing visited vertices, whereas depth-first search is graph traversing method that uses the stack for storing visited vertices. Breadth-first search that is called shortly BFS, BFS is used to traverse through the graph. The queue is used to store visited vertices in BFS. BFS work on the vertices, visited vertices are stored in the queue. Vertices are stored one by one. Each node in a graph is fully explored and then other vertices of the graph is visited.

Depth First search that is known as DFS is also a graph traversing method that used the stack for storing the vertices. Breadth-first search is not edge based method whereas depth-first search is edge based method. Depth-first search work in the recursive fashion where vertices are explored through edges. In depth first search, each vertices is visited once that inspected twice.

**Comparison Chart**

Basis |
BFS |
DFS |

Meaning |
Breadth first search is graph traversing method that uses a queue for storing visited vertices | Depth-first search is graph traversing method that uses the stack for storing visited vertices. |

Algorithm |
Breadth first search is vertex-based algorithm | Depth-first search is edge based algorithm |

Memory |
Breadth first search is memory inefficient | Depth-first search is memory efficient |

Application |
Examines the bipartite graph, connected component and shortest path present in a graph. |
Examines two-edge connected graph, strongly connected graph, acyclic graph and topological order. |

** ****BFS**

**Breadth-first search that is called shortly BFS, BFS is used to traverse through the graph. The queue is used to store visited vertices in BFS. BFS work on the vertices, visited vertices are stored in the queue. **

**Vertices are stored one by one. Each node in a graph is fully explored, and then other vertices of the graph are visited. Breadth-first search is used to find that graph is connected or not. Breadth-first search is used for detecting a bipartite graph. Finding the shortest paths is done by using BFS.**

**DFS **

**Depth First search that is known as DFS is also a graph traversing method that used the stack for storing the vertices. Breadth-first search is not an edge based method whereas depth-first search is edge based method. Depth-first search work in the recursive fashion where vertices are explored through edges. In a depth-first search, each vertex is visited once that inspected twice.**

**Key Differences **

- Breadth-first search is graph traversing method that uses a queue for storing visited vertices whereas Depth-first search is graph traversing method that uses the stack for storing visited vertices.
- Breadth-first search is vertex-based algorithm whereas Depth-first search is edge based algorithm
- Breadth-first search is memory inefficient whereas Depth-first search is memory efficient.
- Examines the bipartite graph, connected component and shortest path present in a graph whereas Examines two-edge connected graph, strongly connected graph, acyclic graph and topological order.

**Conclusion **

**I**n this article above we see the clear difference between breath first search and depth-first search with implementation.