Maurice Tutor

(5)

$15/per page/Negotiable

About Maurice Tutor

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Algebra,Applied Sciences See all
Algebra,Applied Sciences,Biology,Calculus,Chemistry,Economics,English,Essay writing,Geography,Geology,Health & Medical,Physics,Science Hide all
Teaching Since: May 2017
Last Sign in: 398 Weeks Ago, 3 Days Ago
Questions Answered: 66690
Tutorials Posted: 66688

Education

  • MCS,PHD
    Argosy University/ Phoniex University/
    Nov-2005 - Oct-2011

Experience

  • Professor
    Phoniex University
    Oct-2001 - Nov-2016

Category > Computer Science Posted 13 Jul 2017 My Price 12.00

recursive method

Write a recursive method that counts the number of creatures on a grid. A creature is defined as a contiguous collection of 1's (connected horizontally and vertically).

Input

Max dimensions of the array

Distribution of organisms on the array

Output

The number of creatures and the layout of the grid showing the locations of the creatures.

Requirements checklist:

  1. Documented source code (include any assumptions you make)

Input File (in.txt)

The format of the input file is as follows: First line is the dimensions of the grid.. Then the grid containing 1s for the creatures and 0s for the spaces. The file terminates by 0 0.

5 5

0 0 0 0 0

0 1 1 1 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

5 5

0 0 0 0 1

0 1 1 1 0

1 0 0 0 0

0 0 0 0 0

0 0 0 0 0

0 0

Output File (out.txt)

Experiment # 1

Number of Creatures: 1

0 0 0 0 0

0 1 1 1 0

0 0 0 0 0

0 0 0 0 0

0 0 0 0 0

Experiment #2

Number of Creatures: 3

0 0 0 0 1

0 2 2 2 0

3 0 0 0 0

0 0 0 0 0

0 0 0 0 0

Answers

(5)
Status NEW Posted 13 Jul 2017 10:07 PM My Price 12.00

Hel-----------lo -----------Sir-----------/Ma-----------dam----------- Â----------- Th-----------ank----------- Yo-----------u f-----------or -----------usi-----------ng -----------our----------- we-----------bsi-----------te -----------and----------- ac-----------qui-----------sit-----------ion----------- of----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill-----------

Not Rated(0)