Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

use C++ to answer below 2. Blob Boundaries 1 5 6 7 8 10 11 12 Description: A Blob is a shape in two-dimensional integer

use C++ to answer below
image text in transcribed
image text in transcribed
image text in transcribed
2. Blob Boundaries 1 5 6 7 8 10 11 12 Description: A Blob is a shape in two-dimensional integer coordinate space where all cells have at least one adjoining cell to the right, left, top, or bottom that is also occupied. Given a 10x10 array of boolean values that represents a Blob uniformly selected at random from the set of all possible Blobs that could occupy that array, write a program that will determine the Blob boundaries. Optimize first for finding the correct result, second for performing a minimum number of cell Boolean value reads, and third for the elegance and clarity of the solution. 13 V There are no right or wrong answers - we assess each solution based on the quality of thinking, the tangible progress made, and the time it took to produce. To keep the evaluation fair and efficient, we generally won't answer follow-up questions about the problem. If you aren't sure about something, just make reasonable assumptions and let us know what questions you would have asked if given the opportunity. 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 30 31 Similarly, feel free to share alternative ways of the thinking about or solving the problem if you feel that you are limited in this scenario. Note: The output will NOT be graded by text-matching alone and will be evaluated on the above criteria Thus, all compiling submissions will return a score of 10 and "Did not grade. Input Format Input Format: Locked stub code in the editor reads the following input from stdin and passes a 2D integer array to the function. The details of the input format should not be w relevant to you due to the stub code, but they are as follows: ENDRORE The first line describes the number of rows in the input grid ( = 10) The second line describes the number of columns in the input grid (= 10) Each line afterwards is a"-delimited array of boolean integers describing a row in the input grid Output Format: The function should print the Top, Left, Right, and Bottom boundaries relative to the zero indices of the 2D array (the top left corner). It should also print the number of times a cell was read from the input grid. 1> #include ... 5 6 * 7 * Complete the function below. 8 */ 9 void getBlobBoundaries (vector > inputGrid) { 10 11 } 12 13 int main() 14 [ 15 int inputGrid_rows = 0; 16 int inputGrid_cols = 0; 17 cin >> inputGrid_rows >> inputGrid_cols; 18 vector vector > inputGrid(inputGrid_rows); 19 for(int inputGrid_1 = 0; inputGrid_1 > inputgrid_tmp: 23 inputorid inputGrid_13.push_back(inputgrid_tmp); 24 25 26 getBlobBoundaries (inputGrid); 28 return 0; 30 3 } 27 29 31 2. Blob Boundaries 1 5 6 7 8 10 11 12 Description: A Blob is a shape in two-dimensional integer coordinate space where all cells have at least one adjoining cell to the right, left, top, or bottom that is also occupied. Given a 10x10 array of boolean values that represents a Blob uniformly selected at random from the set of all possible Blobs that could occupy that array, write a program that will determine the Blob boundaries. Optimize first for finding the correct result, second for performing a minimum number of cell Boolean value reads, and third for the elegance and clarity of the solution. 13 V There are no right or wrong answers - we assess each solution based on the quality of thinking, the tangible progress made, and the time it took to produce. To keep the evaluation fair and efficient, we generally won't answer follow-up questions about the problem. If you aren't sure about something, just make reasonable assumptions and let us know what questions you would have asked if given the opportunity. 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 30 31 Similarly, feel free to share alternative ways of the thinking about or solving the problem if you feel that you are limited in this scenario. Note: The output will NOT be graded by text-matching alone and will be evaluated on the above criteria Thus, all compiling submissions will return a score of 10 and "Did not grade. Input Format Input Format: Locked stub code in the editor reads the following input from stdin and passes a 2D integer array to the function. The details of the input format should not be w relevant to you due to the stub code, but they are as follows: ENDRORE The first line describes the number of rows in the input grid ( = 10) The second line describes the number of columns in the input grid (= 10) Each line afterwards is a"-delimited array of boolean integers describing a row in the input grid Output Format: The function should print the Top, Left, Right, and Bottom boundaries relative to the zero indices of the 2D array (the top left corner). It should also print the number of times a cell was read from the input grid. 1> #include ... 5 6 * 7 * Complete the function below. 8 */ 9 void getBlobBoundaries (vector > inputGrid) { 10 11 } 12 13 int main() 14 [ 15 int inputGrid_rows = 0; 16 int inputGrid_cols = 0; 17 cin >> inputGrid_rows >> inputGrid_cols; 18 vector vector > inputGrid(inputGrid_rows); 19 for(int inputGrid_1 = 0; inputGrid_1 > inputgrid_tmp: 23 inputorid inputGrid_13.push_back(inputgrid_tmp); 24 25 26 getBlobBoundaries (inputGrid); 28 return 0; 30 3 } 27 29 31

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

Step: 3

blur-text-image

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

Visual Basic6 Database Programming

Authors: John W. Fronckowiak, David J. Helda

1st Edition

0764532545, 978-0764532542

More Books

Students also viewed these Databases questions

Question

Which of these influenced your life most dramatically?

Answered: 1 week ago

Question

What roles have these individuals played in your life?

Answered: 1 week ago