Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Description Consider the following problem which is similar to the one assignment 3 . Suppose we model an apartment with ASCII characters. Specifically, a space

Description
Consider the following problem which is similar to the one assignment 3.
Suppose we model an apartment with ASCII characters. Specifically, a space can be moved
through. An asterisk * is a wall or furniture that cannot be traversed. Assume that (0,0)
is the upper lefthand corner. For the sake of simplicity you can assume the apartment is
enclosed in * characters.
Complete the recursive function, recF ill, which to replace all of the characters in the
apartment reachable from the given (row,col) location with # characters.
Example:
Starting room:
**********
**
********
****
******
***
**********
recFill( room, 3,4):
**********
*########*
****##****
**##**
****##**
*#####**
**********
recFill( room, 3,1):
**********
**
********
*##***
******
***
**********
recFill( room, 0,0):
**********
**
********
****
******
***
**********
(since you start at a *)
(Unreachable areas should remain unchanged)
Continued on the back ,->
/* recFillRoom
* input: the room to process,
* the row and column of the current location being explored
*
* Replace all of the reachable spaces reachable from (row, col) with #
*
* HINT: You dont actually need to know the length/width since the
* apartment is fully enclosed in * characters
*/
void recFill( char** room, int row, int col )
{
/* Base cases: */
/* Recursive cases: */
}

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

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2014 Nancy France September 15 19 2014 Proceedings Part I Lnai 8724

Authors: Toon Calders ,Floriana Esposito ,Eyke Hullermeier ,Rosa Meo

2014th Edition

3662448475, 978-3662448472

More Books

Students also viewed these Databases questions

Question

Discuss why human resources managers need to understand strategy.

Answered: 1 week ago

Question

2 What are the implications for logistics strategy?

Answered: 1 week ago