Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

======================================================================== Please write an iterative code for this You can use linear data structures such as stack, queue, list, or vector. ======================================================================== The researchers at

========================================================================

Please write an iterative code for this

You can use linear data structures such as stack, queue, list, or vector.

========================================================================

image text in transcribed

The researchers at a medical center wish they had taken a computer programming course way back when they were at medical school. These days, in addition to attending their research, they find themselves entangled with having to learn the R and Python languages in order to wrangle, visualize and model data collected from patients. 1,2 They simply have no time and no patience for R or Python! So they have decided to hire you as a programmer to assist, providing you with a bit of background information and a clear description of your task. The researchers have discovered that, when certain cells are introduced into a new environment, the cells quickly form colonies. To study the effectiveness of a drug they are developing, they need to figure out the size and number of the colonies in the environment. Fortunately, they can map the environment onto a grid of Os and 1s that might, for example, look something like this: 0 0 0 1 1 0 1 1 0 0 0 1 1 1 0 1 1 1 0 1 1 0 0 0 0 1 0 0 0 1 0 0 0 0 0 1 1 1 1 1 0 1 0 0 1 0 0 0 1 0 1 0 0 0 0 0 0 1 1 1 1 1 1 0 0 1 0 1 0 0 0 0 1 0 1 1 0 1 1 0 0 1 1 1 0 1 1 1 0 1 0 0 1 0 1 0 1 1 0 1 The locations on the grid each have a row and a column coordinates. A 1 or 0 at a location indicates, respectively, the presence or absence of a cell at that location. Colonies are formed by neighboring cells. Two cells are considered neighbors, if their locations are adjacent either horizontally, vertically, or diagonally. Thus, the maximum number of neighbors a cell can have is 3 for a corner cell, 5 for a cell on a single border, and 8 for a cell not on the borders. Given this background information, you are tasked with developing a ColonyExplorer program that explores and labels the colonies (if any). For example, using the grid above, your ColonyExplorer should produce the following information: AA - AA- B B B - ccc - c D - - - - - - - A - - - ccccc D - - A - - A A DDD - - A - A - E - CC D D D - A A A - F - - E -C- CC - C A: 14 B: 3 C: 20 D: 8 E: 2 F: 1 The information shows that there are six colonies labeled A, B, C, D, E, and F on the grid with size 14, 3, 20, 8, 2, and 1, respectively

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

C++ Database Development

Authors: Al Stevens

1st Edition

1558283579, 978-1558283572

More Books

Students also viewed these Databases questions

Question

What is the purpose of the Salary Structure Table?

Answered: 1 week ago

Question

What is the scope and use of a Job Family Table?

Answered: 1 week ago