Advertisement
Guest User

Untitled

a guest
Aug 28th, 2016
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.20 KB | None | 0 0
  1. void floodfill (int x, int y) {
  2. if (!visited[x][y]) {
  3. visited[x][y]=true;
  4. for (all neighbouring reachable (x,y)) floodfill(x,y);
  5. }
  6. }
  7.  
  8. void main () {
  9. for (all (x, y)) floodfill(x,y);
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement