Answered step by step
Verified Expert Solution
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started