OK...Let's take a moment to look at India's international relations with some of the very important countries, say the United States.
好的,现在来谈谈,印度与一些地位重大的国家,之间的国际关系,比如说,美国。
OK, let me comment this out, and let's look at this next little piece of code. All right.
好,让我添加一点注释,然后让我们看看,下面的一些代码,好。
OK, now, we're going to look at the internal energy, and we're going to pretend that it is explicitly a function of temperature and volume.
好,我们接下来看看内能,我们假设,它是温度和体积的函数。
Now for many of you,when you look at this you may say, "Well,Ok,yes,change is possible.
你们可能会说,“好吧,改变是有可能的。
OK, now, this is a more formal look at that structure.
对,这是一个更规范的结构。
Ah, OK, I misunderstood, so the question is rather look, radio waves are not like forms, to which the answer is yes, that's exactly the problem.
好的,我刚才理解错了,她是问,无线电波不像形式,这么说是对的,这正是问题所在。
OK, in fact if we look at this, if I say, print of p, it prints it out in that form.
好,实际上如果,我们来看看这个,如果我输入,p的显示。
And if I go look at the polar form of this, OK, good, looks right, right?
现在它有一个不同的坐标,以及跟原来相同的角度?
OK. Now, that's a nice simple little test, let's look at a couple of other examples to get a sense of what this will do.
好,那么这是一个很好的小测试,让我们看看其他的一些例子,来明白这个主要用来做什么的。
OK. If we do that, if you look at the handout then, I can now start implementing this.
好,我们开始做,你们可以看看课堂材料。
OK. And I'm going to look to see, is a particular element inside of that list, and again, I'll remind you, that's just giving me the integers from zero up to 9999 something or other.
一个又大又长的列表吧,好的,我打算查找列表中的一个特定元素,我会告诉你,我用的是0到大概是,9999左右的整数。
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.
对,我知道这个方法可以通过内置的算法,来实现,这没关系,我们只是,把它当做一个例子来讲解。
U OK, so let's look at delta u. Delta u is q plus w.
好的,让我们看看Δ
OK. Now, having said that, where should I pick to look in this list?
对不对?中值点?为什么呢?,你答对了但是为什么呢?
If you look at x 2 this one right here in your handout. OK.
课堂材料的第二题2,这是关于做乘方的另外一种方法。
OK. Having done that, then, there are three things that we're going to look at.
好了,做完了上一步,我们还有三件事情要研究。
OK. So if I look at this code, first of all I'm calling search, it just has one call, so looks like search is constant, except I don't know what happens inside of b search. So I've got to look at b search.
首先调用一下搜索,就一步调用,看起来搜索是固定的,除非我不知道二分搜索的原理,那我们来看看二分搜索吧,所以让我们看看,第一行打印出来的内容。
OK, if you look at that then, let's look at what happened when we ran this.
好的,如果再看一下那个,让我们看一下当我们执行这里时会发生什么。
OK. So, let's look at an example.
好的,让我们看一个例子。
But let's look at what we could do with this, OK?
我们能用它们来做什么吧,好不好?
OK, so let's look at the cycle we'll go through.
好,让我们来研究这个循环。
OK? And in fact, if you look at the code up here, and it's on your handout, the very first one, x 1, right here- if I could ask you to look at it-- is a piece of code to do it. And I'm less interested in the code than how we're going to analyze it, but let's look at it for a second.
实际上,如果你看看,你们课堂发的材料上面的代码,第一页上的,就是那-,大家请看看实现的这一部分代码,我不太关心,我们会怎么解释这个代码,首先让我们先看看。
OK. Having said that, let's look at doing some sorts. And I'm going to start with a couple of dumb sorting mechanisms. Actually, that's the wrong way saying it, they're simply brain-damaged, they're not dumb, OK?
我们来做些排序吧,我要开始处理一些愚蠢的排序机制,事实上,我说的不正确,他们就是没脑子,不是笨,发明出来后,他们就在不停的被挑战?
And let's take a look at it. OK?
在我们看代码之前?
OK, so let's look at it.
好了,让我们来看一下这个程序。
OK, and if I wanted to look at it, we can come back over here, and we can see what does c p 1 look like, interesting.
现在对于这里的每个实例,我都赋了x和y值,好,那么如果我想要研究下它,我们可以回到这里来。
OK? You can take a quick look at it, a even with the wrong glasses on, it says if a 1 sorry, b is equal to 1, a I'm just going to return a.
你们可以快速的过一遍,它是这么写的:如果,对不起,是b等于,那么就直接返回。
So I'm going to go over here, and I'm going to type test search-- I can type and if you look at your handout, it's just a sequence of tests that I'm going to do OK. So initially, I'm going to set up the list to be the first million integers.
大家可以看看你们的课堂材料,那儿有一些我要做的实验,好,一开始我先去建立个,含有一百万个integer的数组,对,这有点儿简单,但是这给我提供了这样一个有序的数组。
OK.Let's look at the code-- actually, let's test this out first before we do it.
因此我已经添加了,就像Guttag教授做的那样-啊,应该这么说。
OK. So what does Python look like?
好,那么Python和什么比较像呢?
应用推荐