So when I do the analysis, I want to think about what am I doing here, am I capturing all the pieces of it? Here, the two variables that matter are what's the length of the list, and how many times I'm going to search it?
这里,要关注的,两个变量是列表,的长度以及我要搜索的次数,这种情况下,这个算法赢了?
It's a huge warehouse full of amazing pieces which they pick up from all around the world.
它是个很大的仓库,装满了神奇的东西,它们是从世界各地收集而来的。
And that's a wonderful thing to have because it gives you that modularity, that encapsulation that basically says, when I create a point, the only way I can get at the values, is by using one of the defined methods, in this case it could be Cartesian, Cartesian and get all the pieces of that.
这是很棒的一件事情,因为它让你有了,模块性以及封装性,这基本上也就是说,当我创建了一个点,我能够得到它的值的唯一的方式,就是用一个定义好的方法,在这个例子中也就是。
and he cleans all the pieces embosses them and polishes them and then reassembles the whole thing and a week later I come back and ask "Where is my watch?" And he hands it to me.
他擦干净所有零件,把它们雕琢好,擦亮,他将所有零件重组,一周后我回来问他,“我的手表呢?,“他交给我。
Now another approach would be to take pieces of the pancreas that already have all that capability within them.
现在还有一种方法就是,取一部分健康人的胰脏,移植到糖尿病患者体内
All pieces, classical or pop, one way or the other, end on the tonic.
所有乐曲,无论是古典或流行,无论用什么办法,都终止在主音上
All right, those pieces of code inherently involved something that does depend on the size of the input, or on the particular input.
好,这些代码,肯定会涉及到一些,与输入的大小相关的东西,或者说与特定输入相关。
And immediately, it composed of all the very same pieces that made up my watch.
但其实,这只手表的所有零件都是,原来的。
And immediately, all these pieces are in the very same order as my watch.
所有零件都是按原来的次序,组合装好的。
And I can obviously do the other direction which is I can say skip to index 2 and all the remaining pieces. This lets me slice out, if you like, the front part or back part or a middle part of the tuple as I go along.
很明显我可以从索引2开始切片,所有剩下的元素,这可以让我2,如果你喜欢我这么说的话,取得元素的前面的或者后面的,或者中间的部分。
Is the first part. That says, I took the branch through here that eventually got to the end and said, there wasn't a solution, in which case I'mgoing to print out, there ain't no solution, otherwise I'll print out the pieces. All right, let's check it out. Ah, what did I say?
我是否返回了特殊的none值?是第一部分,这里的意思是我从这个分支,走到这儿最终走到最后,并告诉我这条路没有解决方案,也就是我想要打印的结果,没有符合的结果,否则我会把它们输出来?
应用推荐