Given the code up there, if I want to move a tower of size n, what do I have to do?
鉴于这里的代码,如果我想移动N个圆盘,我该怎么做?
N And we can keep doing"T","A","N", ? and I think you see where it is going.
然后接着移动字母,T,A,和,我想大家应该知道后面是哪些字母了吧。
If I want to move this stack here, I'm going to take a stack of size n minus 1 move it to the spare spot, now I can move the base disk over, and then I'm going to move that stack of size n minus 1 to there. That's literally what I did, OK?
如果我想移动这些圆盘,我先把从n-1个圆盘1,移动到多余的柱子上去,这样我就能把最底下的圆盘放到这儿了,然后再把从n-1个圆盘放到这儿来,这就是确切的我怎么做的对不对?
应用推荐