Skip to content

Commit d0659c7

Browse files
committed
renamed bfs.md to readme and added gifs
1 parent b6a8bdb commit d0659c7

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

Competitive Coding/Graphs/Graph_Search/BreadthFirstSearch/BFS.md

Lines changed: 0 additions & 5 deletions
This file was deleted.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
## Breadth-first search (BFS)
2+
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 neighbours.
3+
4+
--------------------
5+
![](https://upload.wikimedia.org/wikipedia/commons/4/46/Animated_BFS.gif)
6+
7+
--------------------
8+
This is the algorithm for Breadth First Search in a given graph.
9+
10+
* We take a starting vertex , and push all its adjacent vertexes in a queue.
11+
* Now we pop an element from a queue and push all its vertexes in the queue , and we also mark down these vertexes as visited.
12+
* After executing the code, we will get the vertex visited in a breadth first manner.
13+
14+
[More info](https://en.wikipedia.org/wiki/Breadth-first_search)

0 commit comments

Comments
 (0)