We started off talking about binary search, and I suggested that this was a log algorithm which it is, which is really kind of nice.
我告诉了你们这是一个对,数级的算法,这是很棒的,我们来一起看看这个算法到底做了什么。
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开始,然后是。
应用推荐