OK. One of the other things you're going to see is that some of the operators have odd meanings.
好,你们会学会的另外一件事情,是一些操作符,有很奇怪的含义。
There were some things I did learned that were fantastic ok, and there were some things I didn't learned.
有些东西的确很棒,也有些是我没学到的。
And I'm sure you don't remember, but one of the things I had in my recipe, is beat egg whites until stiff. OK.
我相信你们不记得了,但是我说过我食谱中的一件事情是,搅拌蛋清直到变浓稠,好。
OK, so but you still know a number of things.
然而我们还是能做出一些推论。
But, from this moment forth, cell phone goes off, you're out. You leave the room, OK? And, Lord help you if a cell phone goes off during an exam because those things have text messaging capabilities.
但是,从这一刻开始,手机响的话,你们就出去,你们就离开教室,好吗,上帝保佑你的手机不要在考试期间响起,因为它们有发短信的功能。
Now we can think about the fourth period, and the fourth period is where we start to run into some exceptions, so this is where things get a teeny bit more complicated, but you just need to remember the exceptions and then you should be OK, no matter what you're asked to write.
现在我们可以考虑第四周期,而且在第四周期,我们会遇上一些特例,所以事情有,一点复杂,但是你只需要记住,这些特例然后就没有问题了,无论你被要求写什么。
Now why? When I put this class together, I didn't think to myself, "Ok, so what are the things that I need to introduce ?" in order to please the participants in the class, the students?"
为什么?,当我开这门课程时,我自己没想过,“好的,我需要介绍些什么东西,以便能取悦课程的参与者,这些学生呢“
Yeah, it's kind of simple, but it gives me an ordered list of these things, And let's run it. OK.
让我们来运行运行吧,好,我会先去搜索一些数组中没有的元素,让我来试试,看-1在不在这个数组里。
OK, I want to spend the last few minutes just showing you a couple of other things that we can do in here.
好,我想把最后一点时间,用来给大家看看我们能做的,一些其他的东西。
You'll also see in a little while why both of these things would work this way, but it's not what I wanted. OK?
我应该把括弧,而不是方括号放在这里,你们稍后就会,明白为什么这两个符号在这里都是行得通的?
OK, in each case, what these things are doing, is they're doing, what sometimes gets referred to as operator overloading.
这将会是个默认的或者说是,通用的来比较对象是否相同的方法,好,在每个例子中,这些事情正在做的,就是,一些与操作符重载有关的东西。
OK. I know. It looks boring. But it's a structure of the things I want to think about when I go through trying to take a problem and mapping it into a iterative program.
好,我知道这看起来有点无聊,但是这是我要去以迭代的方式,去解决一个问题采取的,措施的大致结构。
Now, one of things I left hanging is, I said, OK, you build it out of primitives.
现在,我落下的一件事情是,我说过了,好的,你在原始数字之外建造它。
OK. So to do this, we're going to have to do a couple of things. All right, the first one is, what do we mean by input size?
好,为了实现这种方法我们,有些事情要做,第一件事情就是,当我们说到输入的大小的时候代表了什么呢?
OK. Having done that, then, there are three things that we're going to look at.
好了,做完了上一步,我们还有三件事情要研究。
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?
我只能做线性搜索了,一次遍历一遍列表,一个一个比较,但如果我想要,那怎样得到有序的列表呢?,现在的一个问题是,我们排序之前?
OK. Once we've got that, we can certainly, though, do things like this.
好,一旦我们写好了,我们当然就可以实现这样的目的了。
OK. Other things.
好了,还有几件事儿。
I really do love these things. And is that right, John? OK, so my apologies that your handout is wrong. I did not think to check about the difference between these things.
我真的很喜欢这些东西,这样对不对John?,好,抱歉你们的课堂手册上面是错误的,我没想要要去检查,这些东西之间的不同。
T Remember, we're trying to get delta H, p we're trying to get dH/dT constant pressure and dH/dp constant temperature. OK, these are the two things were trying to get here.
想要得到在恒压状态下的偏H偏,和在恒温状态下的偏H偏,好的,这是两个我们,在这里想要得到的东西。
We can put a list in the list again, as we've seen before. So let's put the list containing the string a, and I'll print out so now we see something pretty interesting about a list, that we can mix up all sorts of things in it, and that's OK.
数组放到数组中去,让我们把这个包含,字符串a的数组放进去,然后再显示,我们看到了一些,挺有趣的事情:我们可以把各种,各类的东西混合着放进去,没问题。
应用推荐