Question
IN JAVA I am trying to make bases cases for my code so the recurrsion can be just 2 loops controling the columns and rows
IN JAVA
I am trying to make bases cases for my code so the recurrsion can be just 2 loops controling the columns and rows like in the photo below(in the findPath). I think my base cases Need to be "if already visisted, if not a word, if out of bounds, and if last letter", I might be missing some. I have Isword making my stack that calls into isPath and that is where most of my code is. If someone cna please help me with the code I need to write to do so that would be great! The begining there is a chunk of code that is suppose to check if it has been visited and i do not know how to use it.
public class GameBoard public static final int NUM ROWS4; public static final int NUM COLS 4; private static string[] GAME PIECES = { "RIFOBX", "IFEHEY", "DENOWS", "UTOKND", "HMSRAO", "LUPETS", "ACITOA", "YLGKUE", "QBMJ0A", "EHISPN", "VETIGN", "BALIYT", "EZAVND", "RALESC, "UWILRG", "PACEMD" private char[] [] board; private boolean [] [1 visited public String isword(String word) char pink word.charAt (0);//getting first letter /ow looks through path and wil give a boolean which equals findpath and goes to next path StackStep 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