Consider an NxN grid in which some squares are occupied. Two squares belong to the same group if they share a common edge (not just a corner). In the figure there is one group of four occupied squares, three groups of two occupied squares, and two individual occupied squares.
you are to develop a C++ class called Recursion that contains the following:
-a 2D int array with 10 rows and 10 columns.
-a constructor or function that reads a file into the array. Each line of the file is a row of the array. The character . should be converted to 0, and any other character converted to 1
A sample file is attached
-a function print() that causes the printout of all groups contained in the 2D array. It should make a copy of the member array, and make use of a recursive method printGroupWith.
-a recursive method printGroupWith. (Think about the right parameter list.) This function should cross-off the copy of the array as it goes.
-a main function that takes a filename from the command line, creates a suitable Recursion object and calls print on it.
For example, for the sample grid above, the output of your program should be something like (not including comments): Note that your order might be different
Group 1: (0,9), (1,9) // the two occupied squares in upper right corner
Group 2: (1,3), (1,4) // the two occupied squares in row 1
Group 3: (3,4)
Group 4: (3,7), (4,7), (5,7), (5,8)
Group 5: (4,3)
Group 6: (6,4), (6,5)
You may include additional private helper functions, if you wish.