If I had lists of lists of lists, then it would only take out the first level of it.
贴到另外一个数组的后面,它当然是实现了套数组的操作。
And the obvious question I could start with is, and suppose I ask you, how long does the algorithm implemented by this program take to run?
我开始这个话题的第一个问题是,假设我问你,由这个算法实现的程序大概,要运行多久才能给出答案?
So, the curious thing about recursion is that pretty much always can you implement this idea of doing the same thing again and again and again but with smaller bytes each time.
可见,递归算法中新奇的一点是,为了实现一个想法,你可以一遍又一遍地做相同的事情,但每次的规模都会有所减小。
And psychologists have coined a term, talk about self-fulfilling prophesies, and the claim here more specifically is what's known as "the Pygmalion effect."
心理学家造了一个新术语,来讨论这种自我实现的预言,准确来说这个现象就是,皮格马利翁效应“
One of the important ideas behind in this book, "Acts of Faith", is that, you say, we should be approaching this with the same kind of urgency and the same kind of resources.
信仰行为》这本书蕴含的一个重要观点,据您所说是,我们应该实现这个目标,这同样十分迫切,我们要利用相同的资源。
We'd have to figure out a way to achieve octet stability by electron transfer.
我们需要找到一个可以通过电子转移,而实现八隅体的方式。
The Fed is worried about a collapsing house of cards.
美联储担忧的是,一个失败的不切实际无法实现的计划。
So for me, Teach for America is an opportunity to actually align my actions with my thoughts and my hopes and be part of the change we all talk about wanting to see.
为美国而教“对我来说是一个,真正让我实现想法和希望的地方,参与实现我们都想见到的改变。
You cannot truly achieve what you want and need as a human being without being an active and loyal citizen of this great community which you need to achieve what you want in life.
在这个你必须有所作为的庞大社会中,如果你并非一个积极且虔诚的公民,那么你就无法真正实现,你的所需和所求
You make a life plan, what you want to accomplish in your life, and well, obviously enough, some of us will die too soon, not just in terms of, "oh, well, life still could've had good things," but too soon in terms of you didn't get where you wanted to get in terms of your life plan.
比如你订了一个一生的计划,写下你一生想实现的事情,显而易见我们中有些人会死得太早,死得太早并不是说,生活还有美好的事情“,死得太早是因为,你还没有实现你的人生计划。
In class, I left here your ideas about how we here MIT may help in data free.
在课堂上,我留下了一个想法,那就是MIT怎样帮助实现数据免费。
For instance in the past, we had that silly little program for computing the average of some quizzes and it was actually a pretty bad implementation because I had essentially hard coded in the number of quizzes.
比如在以前,我们做了一个,计算平均数的程序,这是一个相当挫的实现,因为我硬编码了测试的数字。
So you're implementing this black box, and if its purpose in life is to actually return a value, you have to tell the compiler what kind of value to expect, and this is going to have ripple effects.
你在实现这个黑盒子,如果它的目的是,返回一个值,你必须告诉编译器你期望的是什么类型的值,这个将是一个连锁反应。
I don't want to spend the whole weekend implementing just a little pop up calendar and frankly it probably would take at least that long to get something that's as interactive and dynamic as something like this that works across all browsers and so forth.
我并不想花费整个周末的时间来实现,这样一个小的弹出式日历,而且,可能至少还要花那么多时间,从而使它,能够在所有浏览器上都能有良好的交互性并且是,动态的,等等。
Well you know what a point is, it's got an x- and a y- coordinate, it's natural to think about those two things as belonging as a single entity.
把这两个坐标认为,是属于一个独立的实体,是理所当然的事情,因此实现这个目的的。
All right. What does this have to do with my divisor example? This says I can make tuples, but imagine now going back to my divisor example and I want to gather up the elements as I go along. I ought to be able to do that by in fact just adding the pieces in.
这意味着我可以创建元组了,但是想像下回到我们的除数的例子,在处理过程中我们想把目标数的除数,收集起来,我应该能够通过把这些数,一个一个加进来来实现这个目的,我正是要去这么做,也就是。
I am going to do that by adding an electron.
加一个电子可实现这一转化。
And that,very often,becomes a self-fulfilling prophecy.
那很可能会成为一个自我实现的预言。
And again, it's kind of a weak implementation.
此外,它是一个有点乏力的实现。
Different Jews have different opinions about how that works and the past few centuries have been an interesting experiment with modernity and how Jew is gonna face that and react to it So that's sort of just a brief introduction to Orthodox Judaism.
不同的犹太人有着不同的看法,那是如何实现的,而且过去的几百年,就是对现代性一个很有趣的实验,也是对犹太人将如何,面对并且回应它,这只称得上是,对犹太教正统派的简单介绍。
Primarily the people who started are Emerson and Moscovici and many others who have done research showing how minority-- very often one person can make a big difference, can make a significant difference.
爱默生和莫斯科维奇是先驱,他们和其他学者都证明少数人-,经常是一个人,如何实现重大改变,能实现显著的改变。
What we're really getting at is the idea of saying I want to have a way of grouping together information into units that make sense. So I can go back to one of those topics we had at the beginning, which is the idea of abstraction, that I can create one of those units as a simple entity, bury away the details and write really modular code.
组合成为有意义的单元,那么这就让我们回到,一开始讲的话题之一了,这就是抽象的概念,也就是我可以以一个简单的,实体的形式创建这样的一个单元,把具体实现隐藏然后写一些,真正模块化的代码,我们在以后的课程中。
And so one of the things we'll look at today is how can we leverage an algorithm, how can we implement an algorithm that at least at first glance the second time we've now seen it feels so obviously better.
因此,今天我们要学习的一点就是,我们怎样才能影响一个算法,怎样实现一个算法,使你在第二次看它时会觉得,至少比你第一次看到它时更好。
And so ease of implementation is actually a very compelling -- metric against which to measure-- -- do you mind toning my voice down a bit-- is a very reasonable measure against which to measure the quality of an algorithm, right.
如此简单的实现实际上是一个很牵强的,度量,与之相对的衡量是-,如果你们不介意,我降低点音量-,是一种用来度量算法质量的,合理的方法。
And so we've got it up here, a nice little recursive implementation of it.
然后在这里有个这样的数列,一个很好的用递归来实现的斐波那契i数列。
But what looks like this orange block as of now in Scratch, add orange to your so called inventory, well, it's gonna take at least two lines of code in C to actually create the inventory array with this first line and then put something like the word orange inside of it.
就好比Scratch里面橘色的这一块,把“桔子“加到所谓的“清单“里面去,在C语言中至少需要两行代码来实现,第一行代码创建一个货单数组,第二行就需要把“桔子“放进去。
And yeah, I know it comes built in, that's OK, what we want to do is use it as an example to look at it.
对,我知道这个方法可以通过内置的算法,来实现,这没关系,我们只是,把它当做一个例子来讲解。
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的话,也就是说数组中的元素小于等于,我对这两个元素进行比较,然后返回结果就可以了,否则的话,我们就去寻找中值点,注意它是怎么实现的,首先这个指向一个列表的开头。
So we want to write programs to do that.
为了实现这一目标我们要去写一个执行程序。
So pictorially, it's as though there's now some other part of the blackboard here, maybe way up here where I can put anything I want that's accessible to main, that's accessible to swap, that's accessible to increment or any other function I might implement because it is, in fact, global.
绘画般地,它是在这里黑板上的其他部分,可能在这里的上面,我在哪里可以放置这些东西,使它们可以被main函数使用,可以被swap函数使用,可以被increment函数使用,或者我所实现的其它函数,因为它实际上是一个全局变量。
应用推荐