They submit their data about their people, their users to us, so Baidu users can easily find information related to that.
校内网将用户数据提交给我们,这样,百度的用户就能够轻松,搜索到相关信息。
I like, if I'm going somewhere for the first time, then I'll definitely go online and kind of google it.
我喜欢这样,如果我是第一次去某个地方,我一定会上网搜索一下。
Yeah, it's kind of simple, but it gives me an ordered list of these things, And let's run it. OK.
让我们来运行运行吧,好,我会先去搜索一些数组中没有的元素,让我来试试,看-1在不在这个数组里。
I'm gonna ask you to find resources that help inform your opinions about how we can do a better job of building a better learning community.
你们要搜索资料,以便于阐述关于,如何更好地,构建学习社群的观点。
There are all kinds of different boxes or the purpose for those boxes are different.
搜索框的功能不尽相同,因为这些搜索框的目的也不同。
And the basic idea was that we had some sort of a line and we knew the answer was somewhere between this point and this point.
去学习的二分搜索是有联系的,这种方法的基础思想,是我们有一个线性的序集,我们也明白答案在其中的某一段区间。
And if you come and ask a question that you could have easily answered by doing the reading, coming to lecture, or using Google, they're going to have less patience.
所以如果你过来仅仅是问一个,你能很轻松的,通过阅读、上课、或者,在谷歌上搜索就能得到答案的问题,他们会失去耐心的。
So this is a nice little search-- sorry, a nice little sort algorithm . And in fact, it's relying on something that we're going to come back to, called the loop invariant.
恩,这是一个很棒的小搜索,抱歉,和很棒的小排序算法,事实上,它依赖于一些我们要回顾的东西,被称作循环不变量。
So when I do the analysis, I want to think about what am I doing here, am I capturing all the pieces of it? Here, the two variables that matter are what's the length of the list, and how many times I'm going to search it?
这里,要关注的,两个变量是列表,的长度以及我要搜索的次数,这种情况下,这个算法赢了?
And what does that say? It says, let's assume I want to do k searches of a list. OK.
如果我们假定要在列表中做k次搜索,在线性的情况下,假定是一个未排序的情况。
I'm going to call it down here with search, which is simply going to call it, and then print an answer out.
然后返回答案,在二分法搜索中,其实有个挺美妙的名称。
OK? So the example I'm going to do, I'm going to search a sorted list.
来搜索目标元素,好,翻到课堂材料的第二页。
And typically, I'm not going to just search once in a list, I'm going to search multiple times.
还要考虑我要如何去使用它?,我不会对一个列表只做一次搜索。
In fact, I think Baidu answers more queries in China today than Google does in the U.S.
说实话,中国人使用百度搜索的次数,比在美国人使用谷歌搜索的次数还要多。
So I made the decision to switch gear and become a consumer-oriented search site.
所以我决定将公司转型,成为一家客户导向型的搜索网站。
Thank you. Hold on to that thought for second, I'm going to come back to it.
我再来回到问题上,并不是假定我在搜索。
We came up with this idea that we open up the interface so that people who owns the data, who owns the content, can submit it to us and we will integrate into our search results.
于是我们有了一个想法,开放一个接口,让拥有数据,以及容量的人,能够将其提交给我们,然后整合到搜索结果中。
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.
就是当我们处理数字的时候,所称的二分检索,在二分法搜索中,我需要记录区间的开始点和尾点,初始化的时候就是-,问题输入的开始点和尾点,当我开始做测试的时候,我想要做的就是去取中值点。
And the portal companies didn't want to buy the best search technology.
因此门户网站并不愿意,购买最好的搜索技术。
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.
首先调用一下搜索,就一步调用,看起来搜索是固定的,除非我不知道二分搜索的原理,那我们来看看二分搜索吧,所以让我们看看,第一行打印出来的内容。
There are already a number of Chinese search services on the market.
当时的市场上已有许多中文搜索服务。
All right? A linear search, I start at the beginning of the list and walk all the way through it. All right, if I'm lucky and it's at the low end, If it's not, if it's at the far end, I've got to go forever, and you saw that last time where this thing paused for a little while while it actually searched a list this big.
如果很幸运就在开头,那运行起来很快,如果是在末尾,那就一直得走到头,上次看到了,如果搜索空间很大,程序都会暂停一会,好的,那我希望你们。
And it's called divide and conquer for the obvious reason. I'm going to divide it up into sub-problems with the hope that those sub-problems get easier. It's going to be easier to conquer if you like, and then I'm going to merge them back. Now, in the binary search case, in some sense, this is a little bit trivial.
因此被称为分治的原因就这么简单,将一个问题分解成一些子问题,并希望这些子问题解决起来比较方便,正如你希望的,求解的过程也会变得简单,下面就是把结果合并起来,现在,在二分搜索的例子里,从某些方面来说,这有点微不足道。
It doesn't need to show you the search result.
页面并不显示所有搜索结果。
Then I started to think, "Is there any way that we can save the consumers' effort and integrate everything, every function, every application, every information needs that a user wishes into one box?"
于是我开始思考,有没有一种办法,使得消费者’,省下精力与时间,将所有功能,所有应用,所有信息,按照用户所希望的,整合到一个搜索框内?
All right. Any questions about bisection search?
好,还有没有关于二分搜索的问题?
We're going to call binary search, it's going to take the list to search and the element, but it's also going to say, here's the first part of the list, and there's the last part of the list, Well, it checks to see, is it bigger than two?
我们将要调用这个二分查找,它将会在列表里面搜索元素,假定这里是,列表的第一个元素,那里是列表的最后一个元素,代码内部到底做了什么?
I did that for about 10 months of period, and that resulted it being a better or the best Chinese search technology.
这样做了有10个月之久,结果就是,百度拥有了更好或者是最好的中文搜索技术。
If it was an unordered list, we were basically stuck with linear search. Got to walk through the whole list to see if the thing is there.
如果是一个未排序的列表,基本上我们就只能使用线性搜索了,通过遍历整个列表来查看。
应用推荐