And in fact if I go off and run this, OK, what I was printing here was s 1 dot length, and that's -- What is it doing?
他们就是一些有结构的实例,实际上如果我去运行下这个,好,我这里输入的?
Let's assume, for sake of argument, the thing I'm looking for is bigger than this. In that case, I'm going to throw away all of this, I'm going to hit that bottom line of that code.
让我们假定不是,假定要找的元素,比这个大,在这样的情况下,这些都擦掉,我要运行到代码的最后一行。
Distorting price signals , making it impossible for the market to respond as it otherwise would have .
扭曲价格信息,让市场无法正常反应,无法在正常市场机制下运行。
And so you care-- you care about ultimately how much time is my algorithm gonna take to perform on that worst case running time.
因此你最终所关心的是,算法在最坏情况下需要多长的,运行时间。
And in fact, if you look down- and I'm just going to highlight this portion, I'm not going to run it- but if you look down here, that's exactly what that does.
实际上,如果你往下看-,我正要强调这一部分,我不会去运行它-,但是如果你看看这儿的话,这个方法确实就是这么做的。
So those are in fact the patterns of zeroes and ones, the bytes that would have been outputted had I hello c remembered to download the compiler to this computer and run it on that little hello.c file.
这些都是0和1的模式,如果我记得下载编译器到计算机上的话,我们就能运行下这个,然后看看输出的字节。
And this was just a formal way of describing the best case running time and in the case of Selection Sort, what was the best case running time?
这是描述最好情况下运行时间的,一种正式的方式,在选择排序中,最理想的运行时间是多少呢?
If there are less than two elements there I just check one or both of those to see if I'm looking for the right thing.
列表里是否剩余超过两个元素?,是否剩余不足两个元素,这里面我就挑一两项来检查下是否运行正常。
OK, there's the first run, I'm going to take a different list.
好的,这是第一次运行,我要测下另外一个列表。
And then I could do things like again, say, okay having done, that let me just run it here, run that, so I've now got polar point 1, and polar point 2.
然后给它们赋值半径和角度,然后我可以进行刚才的操作,也就是说,对刚才的笛卡尔坐标进行的操作,让我们来运行下它吧,运行下,现在我有一个极坐标点。
yeah I run this, yeah, I have a syntax error, yes indeed, because I forgot to comment that one out, all right, and cue, we'll try it again.
运行下,一个语法错误,确实是,因为我忘了把这里注释上了,好,让我们再来试试。
At the end of the first round, I've got the smallest element at the front. At the end of the second round, I've got the smallest two elements at the front, in fact I got all of them sorted out. And it actually runs through the loop multiple times, making sure that it's in the right form.
看看发生了什么,在第一轮结束后,我把最小的元素移到了前面,第二轮结束后,我把最小的,两个元素移到了前面,实际上,所有的元素都排好序了,实际上,这个算法运行了几次循环,确认下这是正确的形式。
So actually, let's just run it and then we'll talk about what it does.
那么,让我们运行下程序,然后来探讨下程序的功能吧。
What happens if I run this sucker?
我运行下这个糟糕的东西会有什么结果?
Alright I'm just going to do that.
好让我运行下程序。
Silly And see what's going on.
让我们试着运行下。
So let me just run it.
让我运行下这个程序。
And again, if I just run this, just to show that it's going to do the right thing, it says enter base, I'm obnoxious, it says oops, wasn't a float, so we'll be nice about it and I enter a height, and it prints out what I expected. I just concatenated those strings together, by the way, at the end.
我再来运行下看是不是做对了,提示输入底,噢,它提示说不是浮点数,我很高兴,然后我输入一个,浮点数作为高度显示结果和我预期的相同,顺便说一句,我只是在最后把这些字符串连接起来了。
3 Let's take y, change it to thirteen, let's run it, hmm.
把y赋值为,试着运行下程序,嗯。
In general, when we wanna talk about running time, we just need a silly place holder, so we'll call it T for time.
一般情况下,当我们讨论运行时间时,需要一种表示方法,这里T表示时间。
Because I know this program was saved by default into my current folder, my current directory, so dot slash means run the program called a.out that's right here in my current directory not in, like, a out my applications folder or somewhere else.
程序默认保存在,当前目录下的文件夹,/意味着运行这个名为“a,out“的文件,是我当前目录下的文件,而不是应用程序文件夹或其他别的地方的。
I'm binding a z to be some value, and then I'm going to run this.
我把z绑定到一个值上,然后运行下代码。
Again if I go back here, let me comment this out.
一对字符串,s1和s3,让我们运行下他们。
We'll run test bi. Whoops!
我运行下test,bi试试,喔!
应用推荐