Log n Log n, because at each stage I'm cutting the problem in half. So I start off with n then it's n n/2 n/4 n/8 over two n over four n over eight.
因为总共有多少层?,因为在每一层,我都是把问题分解成两半,因此以n开始,然后是。
If I'm running at nanosecond speed, 1000 n, the size of the problem, whatever it is, is 1000, and I've got a log algorithm, it takes 10 nanoseconds to complete.
如果这个问题的规模,也就是n,是,如果这个问题是对数级的,这将会占据10纳秒的时间,你一眨眼的时间。
So what we'll do is this problem here, which is let's calculate out what the wavelength of radiation n would be emitted from a hydrogen atom if we start at the n equals 3 level and we go down to the n equals 2 level.
我们来做这个问题,让我们来计算一下,从n等于3到,等于2能级氢原子辐射的波长是多少。
Where you go from problem of size n to a problem of size n minus 1.
或者缩减了2,这都一样的,也就是把问题的规模从n变成了n-1。
应用推荐