Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void floodfill (int x, int y) {
- if (!visited[x][y]) {
- visited[x][y]=true;
- for (all neighbouring reachable (x,y)) floodfill(x,y);
- }
- }
- void main () {
- for (all (x, y)) floodfill(x,y);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement