Well, notice again, on each level of the tree, when I actually do the merging, so this remember, is when I wrote down just the numbers when I bottomed out with the list of size 1.
请注意,在这棵树中的每一层,我真正做合并时,就将每个大小为1的列表中的,数字写下来。
One, two, three, four, so on each level of the picture I'm drawing, I've seem only to be looking at each number once.
,2,3,4,可见,在我画的,这幅图的每一层上,对每个数字,都只会用到一次。
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开始,然后是。
On each level in the picture, I'm touching each number once, alright.
在这幅图的每一层上,我只会移动每个数字一次。
应用推荐