Given the code up there, if I want to move a tower of size n, what do I have to do?
鉴于这里的代码,如果我想移动N个圆盘,我该怎么做?
So it feels a little backward mentally perhaps, 1 but this is saying, "do this block of code as long as n is less than 1."
所以它感觉可能有点迟缓,但是它指明,“只要n小于,执行这段代码“
You can certainly hit Enter but as we saw-- seen that very quickly makes a mess of your code and such and so backslash N is new line.
你也可以敲回车键-,但是会让你的代码看起来乱七八糟,反斜杠n就是换行符。
So this line or these lines of code up here are arguably constant time steps to say if N is less than 2 in return, that it will always take maybe one step, maybe two steps, some number of fixed CPU cycles.
如果N小于2并返回,那么这些行所对应的代码,通常只需要执行一步,或者两步,具体数字与CPU周期有关。
应用推荐