Consider an N × N grid in which some squares are occupied. Two squares belong to the same group if they share a common edge. In Figure 30 there is one group of four occupied squares, three groups of...


Consider an N × N grid in which some squares are occupied. Two squares belong to the same group if they share a common edge. In Figure 30 there is one group of four occupied squares, three groups of two occupied squares, and two individual occupied squares. Assume that the grid is represented by a two-dimensional array. Write a program that


a. Computes the size of a group when a square in the group is given


b. Computes the number of different groups


 c. Lists all groups

Nov 18, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here