if you want to move only one disk { just do it, and print the move } else if you want to move N disks { move N-1 disks from the "from" pile to the "spare" pile move one disk from the "from" pile to the "to" pile move N-1 disks from the "spare" pile to the "to" pile }Write a recursive Java method to implement this algorithm.
public static void doNumbers(int number) { System.out.println(number); if (number % 2 == 0) { doNumbers(--number); } else { doNumbers(number/2 + 1); } }
[an error occurred while processing this directive]