Question: move method: public static String move (int n, char orig, char dest, char temp) { final String DIRECT_MOVE = Move disk + n +

move method:
public static String move (int n, char orig, char dest, char temp) { final String DIRECT_MOVE = "Move disk " + n + " from " + orig + " to " + dest + " "; if (n == 1) return DIRECT_MOVE; String result = move (n - 1, orig, temp, dest); result += DIRECT_MOVE; result += move (n - 1, temp, dest, orig) ; return result; } // method move
Show the first three steps in an execution-frames trace of the move method after an initial call of move (4, 'A', 'B', 'C')
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
