So we've seen one example of this, this idea of walking through all the integers looking for the square root.
现在计算机速度很快了,我可以把这个数字设的更大点,计算机会去很快的做这个事情。
So it's certainly at least linear in the length of the list. For each starting point, what do I do?
它至少是线性的计算列表的长度,每次到了循环开始的点?
Now, we get to draw some lessons out of this thing, so everybody who's feeling a little bit shell shocked from having been doing algebra and calculus and drawing pictures and feeling like they've been cheated into taking a class that looks far too much like economics, calm down we're going to actually talk right now.
下面我们从中总结点经验出来,那些因为代数和微积分计算还有绘图,而感到十分不爽的同学,你们是不是感觉被我忽悠了,才会选这门一点都不像经济学的课啊,稍安勿躁,我们马上切入正题
So any point I pick on that path will be equal to p1, V1 to the gamma.
也就是说路径上面任取一个点,计算p,V^γ
It says, well I'm going to print out first and last just so you can see it, and then I say, gee 2 if last minus first is less than 2, that is, if there's no more than two elements left in the list, then I can just check those two elements and return the answer.
然后它计算了尾点和开始点的差,如果小于2的话,也就是说数组中的元素小于等于,我对这两个元素进行比较,然后返回结果就可以了,否则的话,我们就去寻找中值点,注意它是怎么实现的,首先这个指向一个列表的开头。
Now, these comments, frankly, are brain-damaged, or computationally challenged if you prefer.
现在,这些注释,实在点说,没什么用,或者说是对计算有挑战的,如果你喜欢这么说的话。
So I just computed the radius of that particular thing. Right?
这个点的半径,对不对?,计算角度是一样的道理?
应用推荐