/*BFS code by chormen*/
#include<stdlib.h>
#include<string.h>
#include<stdio.h>
#include<math.h>
#define sz 10
#define NIL 0
#define INF 1000000
char color[sz];
long mat[sz][sz];
long par[sz],dist[sz];
long que[sz*sz],head=0,tail=0;
long vert,edge,start,end,Unode;
void enqueue(long data)
{
que[tail]=data;
tail=tail+1;
}
long dequeue()
{
if(head==tail)
return -1;
head=head+1;
return que[head-1];
}
void printPath(long Vnode)
{
if(start==Vnode)
printf(" %ld",start);
else if(par[Vnode]==NIL)
printf("NO PATH EXISTS.");
else
{
printPath(par[Vnode]);
printf(" --> %ld",Vnode);
}
}
void BFS()
{
long adj;