This is the max searching algorithm diagram:
So, I wonder how can draw diagram for HaNoi Tower program:
package tunl;
public class TowersApp {
static int n = 3;
public static void main(String[] args) {
TowersApp.doTowers(3, 'A', 'B', 'C');
}
public static void doTowers(int n, char from, char inter, char to) {
if (n == 1) {
System.out.println("disk 1 from "+ from + " to " + to);
} else {
doTowers(n-1, from, to, inter);
System.out.println("disk " + n + " from " + from + " to " + to);
doTowers(n-1, inter, from, to);
}
}
}
I can't draw it. Anyone can help me !!!