Question: Need simple C++ code to count how many cells in a blob. See required output. 1. Counting Cells (20 pts) Consider a grid of cells

 Need simple C++ code to count how many cells in a

Need simple C++ code to count how many cells in a blob. See required output.

1. Counting Cells (20 pts) Consider a grid of cells in two dimensions, where each cell is considered empty or fi1led. Any number of cells that are connected constitutes a blob. Every cel can either be connected to 4 adjacent cells (vertically, horizontally) or to 8 adjacent cells (vertically, horizontally, diagonally). The goal of your program is to count the number of cells in a blob, given a starting cell. Input The input for this program is provided as command line arguments, as shown below: fnane> File name for the grid of cells M> Number of rows in the grid N> Number of colunns in the grid Row of the starting cell Column of the starting cell CONN> Connection type. Can be either 4 or 8 The rows are numbered 1 through M from top to bottom, and the columns are numbered 1 through N from left to right. 2 File name for the grid of cells M> Number of rows in the grid N> Number of colunns in the grid Row of the starting cell Column of the starting cell CONN> Connection type. Can be either 4 or 8 The rows are numbered 1 through M from top to bottom, and the columns are numbered 1 through N from left to right. 2

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!