diff --git a/Breadth First Search/BFS.c b/Breadth First Search/BFS.c new file mode 100644 index 0000000..c454c24 --- /dev/null +++ b/Breadth First Search/BFS.c @@ -0,0 +1,73 @@ +#include +#include +#define MAX 10 + +void bfs(int graph[][MAX],int visit[],int n,int start) +{ + int f=0,r=-1,i; + int q[10],node; + visit[start]=1; + q[++r]=start; + while(f<=r) + { + node=q[f++]; + for(i=0;i