OK. I know how to do that, right?
然后再写一个小循环?
And secondly, I think that, even if they don't know how to do a problem,
二是,我觉得,即使他们不知道怎么做一道题,
I just want to know the bottom line; how much do I have to pay for the whole company?
我只想知道底价,也就是买下整个公司最少要花多少钱
Notice one last piece. If I'm going to do that, run through all possible answers, I still want to know, gee, what if there aren't any answers? How do I return that case?
注意最后一段,如果我要这样做,也就是运行所有可能的答案,我还是想知道要是没有结果呢?,在这个例子中应该返回什么呢?
But if you say, well, I don't know how to do this, I am not going to bother, don't grade the paper.
但是如果你说,好吧,我不知道怎么做这个,我想麻烦,别给试卷评分。
He had a little electrical thing just on— I don't know how he thought to do this.
将一个小型的电极插在,不知道他是怎么想到要这么做的
I don't know how to turn it on, I don't know what to do.
我不知道怎样打开,不知道要做什么。
I think what makes a difference is not only do you, yourselves, know better how to play this game now, but you also know that everybody around you knows better how to play the game.
我觉得因为不仅你们自己,玩这个数字游戏玩得更好了,你们也了解到周围的人,也玩得更高了
I'd be interested to know, gentleman down here, how do you do this?
我很好奇,我想知道,下面这位男士,你是怎么听的
I don't know how to do it really.
我不知道要多快才行。
If unfamiliar, these are the mechanical computer devices that you have to use to buy a ticket on the T these days and there was one of these really awkward but touching situations where it was clear that this woman had no idea, you know, what to do, how to get from here to here, and I could see her just staring at the turnstiles that you're supposed to go through to get into the subway.
如果不熟悉,这是机械计算机设备,当今你必须使用它们来买地铁票,它们实在是难操作的,这个令人同情的情况是,明显这位老太太不知道怎样操作,怎样从这一步到那一步,我看见她只是凝视着,地铁的栅门口。
And the third thing I need to decide is how do I combine? You know, point out to you in the binary search case, combination was trivial. The answer to the final search was just the answer all the way up.
第三个问题是我需要决定如何进行合并?,就你们所知的,在二分查找中所打印出来的,合并的过程是非常简单的,最后查询的结果,就是一路上来所以的结果。
And yeah, I know you know how to do it, but let's think about what might happen if I wanted to do that.
对,我知道你们知道该怎么做,那么让我们看看如果我,想要完成的话会发生什么。
Oh, but how do I know how long it takes to do x 2?
但是,我想知道用第二种方法,做要多长时间呢?
What I want to do today is three things: I'm going to start-- actually, I shouldn't say start, I'm going to do a little bit of administrivia, the kinds of things you need to know about how we're going to run the course.
今天我要做三件事儿:,我要开始了--其实不应该说开始,我准备做一点儿文案工作,也就是关于怎么上课的,一些你们必须知道的东西。
Well let's see. My fall back is, I could just do linear search, walk down the list one at a time, just comparing those things. OK. So that's sort of my base. But what if I wanted, you know, how do I want to get to that sorted list? All right?
我只能做线性搜索了,一次遍历一遍列表,一个一个比较,但如果我想要,那怎样得到有序的列表呢?,现在的一个问题是,我们排序之前?
I don't know how to do that.
因为没有办法这么做。
Well, one answer is because what I-- how I score on that test isn't going to tell you anything about me It's not going to relate to my grades It's not going to relate to how well I'm liked ? How do we know the SAT is useful?
一个原因是,我在那个测试中的得分,不会透露出任何我的信息,与我的学习成绩无关,也不会说明我有多受欢迎,我们怎么知道SAT有没有用?
But notice what this does. The first thing it does is, it says, let's check and make sure x is greater than or equal to 0. If it isn't, notice what's going to happen. None of that block is going to get executed, and it's going to come down here and print out a useful piece of information, which says, hey, you gave me a negative number. I don't know how to do this.
做的是和以前一样的事情,但是注释它做了什么,第一件做的事情就是,程序说,要去检查并且确信x是大于等于0的,如果不是的话,请注意会发生什么,下面的代码都不会被执行,程序会到这里来然后显示一些有用的信息,信息会说,嘿,你给了我一个负数,我不知道该怎么弄这个了。
应用推荐