Students, graduate students who said I want to do as you do. I want to write about love and sex, the meaning of life and film and one shot is I always say, but where you gonna get a job?
我的研究生有的说,我想和你一样写爱情和性爱,揭示生活的意义,写电影,和,镜头,我会这么回答,你去哪里找工作?
Oh, man. Um, I'm not 100% sure what I want to do as far as careers go.
天啊,就未来的职业来说,我还没有百分百的打算。
Then I'm on the winning side, and what I want to do is kill as many of these guys as I can.
而我作为胜利的一方,要做的是尽可能的杀死这些人
As I mentioned at the end of last lecture, what I want to do is offer us a set of thought experiments.
正如我在上一讲最后提到的,我想做一些思考实验。
But I want to stress again, as long as I do the base case right and my inductive or recursive step reduces it to a smaller version of the same problem, the code will in fact converge and give me out an answer.
就开心的去做吧,但是我想再次强调,只要基础事件处理正确而我的递归,或递推步骤能把它简化为更简单的同类问题,那么这段代码就可以收敛。
These are all real questions and I raise them now myself because they are questions I want you to be thinking about as you do your reading and work through this course.
这些都是很真实的问题,我现在提出来,因为这些是,我要你们思考的问题,在你们阅读时,还有在做本课的研究时。
But I think as you get older, like when you were younger, you might want to do acting
但是我觉得你胆子大一些的时候,比如小的时候,你可能想当演员,
I just want to make mention of this in case there's ever doubt, generally parentheses do solve your problem as an arithmetic but do realize this is some lower level details we'll come back to over time.
是想告诉大家如果你对某些式子的前后运算关系不确定,就加上括号,这都是一些小细节,我们以后还是会再提到的。
I want to do something that might seem odd as I begin.
开始时,我想做一件可能很奇怪的事。
So what I want to do is, I want to lay this out a little bit more formally as a game, since we haven't done anything like this for a week or so, we're going to play the game.
我想做的是,把这个安排得更正式一点 就像博弈一样,因为我们已经大约一个星期没有这样做了,我们将做这个博弈
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.
对,我知道这个方法可以通过内置的算法,来实现,这没关系,我们只是,把它当做一个例子来讲解。
So, what I want to do is take at least a couple of minutes and pursue some of these extra features as well.
所以我想至少花几分钟,来谈谈其中的一些特征。
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.
这意味着我可以创建元组了,但是想像下回到我们的除数的例子,在处理过程中我们想把目标数的除数,收集起来,我应该能够通过把这些数,一个一个加进来来实现这个目的,我正是要去这么做,也就是。
So in some sets, as long as x has the value I want, it ought to do the right thing.
所以在某些结构中只要x的,只是我想要的我就能得到正确的结果。
Or, for that matter, if you've got some quick reactions or thoughts or responses to the arguments that I'm laying out and you want to share them with the class as a whole, then very much I want to invite you to do this.
或者,关于那一点,如果你很快有回应,以及关于那个争论的想法或者反应,那么我会敞开胸怀,如果你想和全班同学分享这个,我会非常想邀请你这样做的。
As I said, what we want to do is, we want to count the number of basic steps it takes to compute a computation as a function of input size.
我刚才提到了,我们要建立,一个根据输入大小的方法来计算,一个计算过程需要的时间,建立这个方法需要几步呢?
So if I were to solve this problem, here's the way I would do it. I would say, first thing I want to do, is I want to input a value for the base as a float.
如果我想要解决这个问题,这就是我要解决它的方式了,第一件我要做的事情就是要,输入一个浮点数作为三角形的底。
OK. All right, let me show you one other tool that I want to use. Which is, I've written that piece of code, I ought to check it. Well, I could just run it, but another useful thing to do is, I'm, especially as I want to debug these things, is to simulate that code.
好,那么,让我给大家讲下,我想用的另外一个工具吧,也就是,我已经写好了这一块代码,我应该去检查检查,那么我可以去运行它,但是特别是当我想要调试代码的时候。
If I wanted to use print as a variable name, how do I get the system to decide gee, do I want print as a value for something, or do I want print as a command?
如果我把print当做一个变量名,我如何让系统来决定,我是要把print当做一个命令来用呢,还是要把它当做一个变量名来用呢?
应用推荐