We did that, we came up with very good Chinese search engine technology, and we signed up a lot of the Chinese portals in a very short period of time.
我们开发了,很好的中文搜索引擎技术,并在短期内,和许多门户网站公司,签了合约。
And what does that say? It says, let's assume I want to do k searches of a list. OK.
如果我们假定要在列表中做k次搜索,在线性的情况下,假定是一个未排序的情况。
So, with that said, we like to Google ourselves sometimes FlyBy and so we discovered that FlyBy last night mentioned CS50 among some other courses in its last minute shopping list.
如此说来,我们有时候会喜欢用Google搜索,然后我们发现昨晚在CS50的其他课程上提到的,在最后一分钟的购物清单里。
If we could do sort, then we saw, if we amortized the cost, that searching is a lot more efficient if we're searching a sorted list.
如果我们可以做排序,然后我们可以看到,如果我们分摊开支,在有序列表中搜索将会变得更高效。
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.
就是当我们处理数字的时候,所称的二分检索,在二分法搜索中,我需要记录区间的开始点和尾点,初始化的时候就是-,问题输入的开始点和尾点,当我开始做测试的时候,我想要做的就是去取中值点。
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?
我们将要调用这个二分查找,它将会在列表里面搜索元素,假定这里是,列表的第一个元素,那里是列表的最后一个元素,代码内部到底做了什么?
If we can sort things, you know, we get this n log n behavior, and we got a n log n behavior overall. But can we actually do better in terms of searching.
如果我们可以排序,如你所知,我们有n,log,n级别的算法,并且我有一个整体的n,log,n级别的算法,但是我们在搜索方面可以做的更好吗?
应用推荐