Question: Create a recursive algorithm that determines if a path exists from the outside of the debris field to the center. The debris field is always
- Create a recursive algorithm that determines if a path exists from the outside of the debris field to the center. The debris field is always square (n by n) and n will always be greater than 1, and always odd. You can enter the debris field from any of the outside spaces, and you simply need to return true if a path exists, and false if a path does not exist. For movement you can only go up, down, left or right. You cannot move diagonally. I have included a small file for you to write your code in before you merge it with the remainder of your assignment (In the additional files section of this module). Your method name MUST use the following header:
- private void findCenter(int row, int column) {
}
Step by Step Solution
There are 3 Steps involved in it
Solution Here is the required code in Java A global variable to store the debris field as a 2D array of chars represents an empty space represents a debris and C represents the center private char deb... View full answer
Get step-by-step solutions from verified subject matter experts
