An image can be represented as a grid


The Grid Problem

An image can be represented as a grid of black and white cells. Two cells in an image are part of the same object if each is black and there is a sequence of moves from one cell to the other, where each move is either horizontal or vertical to an adjacent black cell. For example, the diagram below represents an image that contains four separate objects, one of them consisting of a single cell.

Complete method AlterGrid using the header below, such that all cells in the same object as Grid[Row][Col] are set to White; otherwise Grid is unchanged. Grid is a two-dimensional array of boolean elements. An element value of true means a black cell and an element value of false means a white cell.

public void AlterGrid(boolean Grid[][], int Row, int Col)

Request for Solution File

Ask an Expert for Answer!!
Basic Computer Science: An image can be represented as a grid
Reference No:- TGS082455

Expected delivery within 24 Hours