Spilling a dark liquid on a white tablecloth causes a stain. Let’s divide the tablecloth into a rectangular arrangement of square cells, such as the following one: The blue cells represent the stain....



Spilling a dark liquid on a white tablecloth causes a stain. Let’s divide the tablecloth into a rectangular arrangement of square cells, such as the following one:


The blue cells represent the stain. We want to know the stain’s size, that is, how many blue cells are connected to one another either on their edges or at their corners. For example, the stain shown here is of size 6.






Given the location of a cell in the stain, recursively determine the stain’s size. Use a two-dimensional array to represent the cells. Each cell can be either blue or white and has either been counted or not.





May 18, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here