Over the years, the valley has served as a refuge for those in search of solitude, not just Christians, but Sufi Muslims,too.
VOA: standard.2010.08.05
And typically, I'm not going to just search once in a list, I'm going to search multiple times.
还要考虑我要如何去使用它?,我不会对一个列表只做一次搜索。
and you can just search,
你可以搜索,
"But they illustrate what I want to try to do in this book,which is to just broaden the thinking to get away from this traditional sort of radio search.
VOA: standard.2010.04.16
Now, what did I want to do? I wanted to check membership. I want to do search. Well that's simple. Given that representation and some value, I just say gee is it there?
现在,我需要做什么?,我要做成员检查,我要做查找,这就很简单了,给了即定的表示和一些值,我只需要说喂在那儿吗?
Families of those suspected to have been killed in the mid 1980s by agents of the right-wing military regime of Oscar Mejia Victores, say just being able to search for their loved ones is a signal of progress in this country.
VOA: standard.2009.12.18
As she goes further and further in to her search for knowledge-- - and finally her abandonment of that search of knowledge-- she sees more and more that this is not just pattern, that it's these storm systems of suffering and need.
在她逐渐深入的求知过程-,和她最后放弃了对知识的寻找-,她越来越明白这不是模式,而是苦难而又需要的风暴系统。
And so if incidentally, you're a representative of a student group and the alike and your Google calendar is not -- in here, you can check just by flipping through the various-- we have over 200 calendars right now and you can search through them here.
如果你是一个学生团体的代表,你的Google日历在此不存在,你可以检查其他各种各样的-,目前我们有200多种日历,你可以在它们之中进行查找。
It's an example of a very common tool that's going to be really useful to us, not just for doing search, but for doing a whole range of problems. That is, in essence, the template the describes a log style algorithm.
不仅仅是做搜索,还可以解决一整类问题,本质上,这个模板就描述了,对数形的算法,我们一会再回来。
But part of the process of being systematic is not assuming that I'm going to get a lucky guess. But not even thinking really hard at this point. But just pruning the search space.
但是系统化的过程是不允许,假设我做出了,一个幸运的猜测的,而是逐步缩小搜索空间。
So, as the gentleman back there said, if I'm searching it once, just use the linear search.
如果我就搜索一次,就用线性搜索吧,另一方面。
I'm narrowing it down. It's getting a little silly but you know I'm going to really be persistent and just follow the rules here of binary search, rather than jumping to conclusions.
按照二分法的规则来做的,而不是直接得出某种结论,很明显这儿我的目的是什么?,显示这两个相同的东西。
If I look for, say, minus 1, you might go, gee, wait a minute, if I was just doing linear search, I would've known right away that minus one wasn't in this list, because it's sorted and it's smaller than the first elements.
如果我要查找-1,你可能要怒了,呵呵,等一等,如果我用的是线性查找,我不会知道-1不在这个列表中,但是列表是排好序的,1又比第一个元素小。
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?
我只能做线性搜索了,一次遍历一遍列表,一个一个比较,但如果我想要,那怎样得到有序的列表呢?,现在的一个问题是,我们排序之前?
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.
第三个问题是我需要决定如何进行合并?,就你们所知的,在二分查找中所打印出来的,合并的过程是非常简单的,最后查询的结果,就是一路上来所以的结果。
It was as if, when we went through this search tree, we never remembered what we got at the bottom, and we just re-computed things over and over.
如果当我们遍历完这棵树,我们不可能,记得我们在最下面得到什么结果,我们只是不断地重复计算,所以这让。
In binary search-- ah, there's that wonderful phrase, this is called a version of binary search just like you saw bin-- or bi-section methods, - when we were doing numerical things- in binary search, I need to keep track of the starting point and the ending point of the list I'm looking 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.
首先调用一下搜索,就一步调用,看起来搜索是固定的,除非我不知道二分搜索的原理,那我们来看看二分搜索吧,所以让我们看看,第一行打印出来的内容。
We're going to call search, which just calls binary search.
我要把它回忆一下,之后我们说的查找算法就是二分查找算法。
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的数组,对,这有点儿简单,但是这给我提供了这样一个有序的数组。
Once I have it sorted I can search it in log n time, but that's still isn't as good as just doing n. And this led to this idea of amortization, which is I need to not only factor in the cost, but how am I going to use it?
一旦对其完成排序,就可以在log,n的时间内对其完成搜索,但是这样做仍然不如n的复杂度,这样做引出了耗时分摊的想法,这时不仅需要考虑耗时的因素?
应用推荐