static int towersN = 3;
statoc int loopCount = 0;
public static void main(String[] args){
}
public static void doTowers(int topN,char from,char inter, char to){
if(topN==1){
loopCount++;
return;
}
else{
doTowers(topN-1,from,to,inter);
doTowers(topN-1,inter,from,to);
}
}
}
No comments:
Post a Comment