Internet users can do a search and find directions for making homemade paper.
VOA: special.2009.07.06
And so, when you do a search, it is sometimes frustrating.
当你们搜索的时候,有时会很沮丧。
And unless, you know, you've been hired to do Pirandello's Six Characters In Search Of An Author, this is not a great thing, because you get something that is really confusing.
可能一点关系也没有,要是你拍的是皮兰德娄的荒诞名剧,《六个找寻作家的角色》,那可能是件好事,因为你得到的是一个足够混乱的结果。
google Imagine you want to search through Google to find a particular page. You want to do it in a second. And you're going to just do it the brute force way, assuming you could even reach all of those pages in that time.
假设你想通过,搜索一个特定的网页,你想在1秒内得到结果,然后你就只管去做了,认为能在1秒内遍历遍所有的网页。
OK? So the example I'm going to do, I'm going to search a sorted list.
来搜索目标元素,好,翻到课堂材料的第二页。
OK. So, what do I want you to take away from this? This idea of binary search is going to be a really powerful tool. And it has this property again, of chopping things into pieces.
从这里学到些什么?二分查找的思想,是一个非常有用的工具,我重复一遍,把问题拆成几部分来解决,那事实上,这里的增长率是多少?
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?
我只能做线性搜索了,一次遍历一遍列表,一个一个比较,但如果我想要,那怎样得到有序的列表呢?,现在的一个问题是,我们排序之前?
You try to design actually I'm going to come back to that in a second. It's like you're trying to use a hash function that spread things out pretty evenly. But the places you store into in those lists may have to themselves have a small list in there, and when you go to check something, you may have to do a linear search through the elements in that list.
你尝试着去设计,实际上过会儿我会回头讲解这个问题,类似于你需要用一个哈希函数,非常平均的将物体分发出去,但是在列表中你数据,映射到的地方可能会有自己的一小段列表,当你回头查找数据的时候,你可能需要在那一小段列表中做线性查找。
应用推荐