Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

A two dimensional array of characters can be considered as a field. Each cell is either water 'W' or a tree 'T'. A forest is

A two dimensional array of characters can be considered as a field. Each cell is either water 'W' or a tree 'T'. A forest is a collection of connected trees. Two trees are connected if they share a side i.e. if they are adjacent to each other with respect to any of the four sides. Given the information about the field, write a function which inputs this 2-D array and returns the size of the largest forest, where size of a forest is the number of trees in it

write code in c++ using function and 2d array

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

Professional Microsoft SQL Server 2014 Integration Services

Authors: Brian Knight, Devin Knight

1st Edition

1118850904, 9781118850909

More Books

Students also viewed these Databases questions

Question

The data set of paint thicknesses given in DS 6.1.8.

Answered: 1 week ago