Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hello, I wrote a method to check all the elements in a 2D array. If it's neighbor is an * it would increment a count

Hello, I wrote a method to check all the elements in a 2D array. If it's neighbor is an * it would increment a count and then replace the value with a count. I'd like to write the same method in recursion.

How can I in Java write a recursive method that checks all of a 2D array neighbors and returns a count.

For example in the array

*...

.*..

It would return

*210

2*10

This must be done with Java and recursion.

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

Joe Celkos Data And Databases Concepts In Practice

Authors: Joe Celko

1st Edition

1558604324, 978-1558604322

More Books

Students also viewed these Databases questions