Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void bf(int x)
- {
- int viz[1000]={0},co[1000],p,u,l,c;
- p=u=1;
- co[p]=x;
- viz[x]=1;
- while (p<=u)
- {
- l=co[p];
- for (c=1;c<=n;c++)
- if (a[l][c]==1 && viz[c]==0)
- {
- u++;
- co[u]=c;
- viz[c]=1;
- p++;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement