Professional Documents
Culture Documents
The objective of this puzzle is to move all the discs (one by one), by following the rules below:
• Only one disc can be moved at a time;
• Only the disc on top can be moved;
• A larger disc cannot be put above a smaller disc.
• You have to implement the above problem, with one of the data structures we have studied until now. You are free to implement a program
using an iterative or recursive method.
System.out.println(q.deQueue());
System.out.println(q.deQueue());
System.out.println(q.deQueue());
}
}