Hanoi
package lab7;public class Hanoi {
public static void main(String[] args)
{
recursive(3,'A','C','B');
}
public static void recursive(int n, char src, char aux, char dst)
{
if(n==0)
{
return;
}
else
{
recursive(n-1,src, dst, aux);
System.out.println("Move "+n+" from "+src+" to "+dst);
recursive(n-1,aux,src,dst);
}
}
}