Therefore, for simple branching programs, the length of time, the complexity the code, is what we would call constant.
因此,对于简单的分支程序,运行的时间长度,算法的复杂度,也就是我们说的常数。
And that then let's me get to, basically, base this code. Having done that, height I simply call base with get float, I call height with get float, and do the rest of the work.
现在让我们看看这段代码,其实已经写好了,我简单的调用下,用来得到一个浮点数,再调用下,来得到另外一个浮点数,然后做剩下的工作就可以了。
And it is that conflict, as it were, between what we might call worldliness and innocence that is the core of Machiavelli's moral code.
可以说,正是那种冲突,那种我们可以称之为世俗理念与纯洁无知之间,的冲突,是马基雅维利道德准则的核心所在。
Again, I want you to start seeing how to map the characteristics of the code- the characteristics of the algorithm, let's not call it the code-- to the complexity.
是算法中的那些特性,我们还是别说代码了,转化为复杂度-,我一会儿还会再讲点儿这个的,但是我们再看一个例子。
OK. So if I look at this code, first of all I'm calling search, it just has one call, so looks like search is constant, except I don't know what happens inside of b search. So I've got to look at b search.
首先调用一下搜索,就一步调用,看起来搜索是固定的,除非我不知道二分搜索的原理,那我们来看看二分搜索吧,所以让我们看看,第一行打印出来的内容。
应用推荐