And what does that say? It says, let's assume I want to do k searches of a list. OK.
如果我们假定要在列表中做k次搜索,在线性的情况下,假定是一个未排序的情况。
I mean, J. K. Rowling, Lloyd Alexander, C. S. Lewis, whatever you like.
比如说,罗琳、亚历山大、路易斯,你喜欢的都行。
How long does it take me to find the k'th element? Linear. Because I've got to walk my way down it. OK? So in this case, you have linear access. Oh fudge knuckle.
线性的!因为我得从头,向下走一步步走,所以这里是线性访问,哦,有问题了吧。
If I had a third axis, I would draw a k, but we don't need that.
如果有第三根轴,我可以画一个矢量 k,但我们现在不需要它
The U.K. Had copied the U.S. Idea -I guess they copied -I don't know where the original -I think it's probably -is it U.K. Cpying the U.S. In this case?
英国效仿了美国的想法,我猜他们是效仿美国的,我也不知道谁先发明的,我认为可能是,存款保险是英国模仿美国
In the linear case, meaning in the unsorted case what's the complexity of this? k times n, right? Order n to do the search, and I've got to do it k times, so this would be k times n.
复杂度是多少?k的n次方,对吧?,在序列n中做搜索,要做k次,所以是k的n次方次,如果先排序后搜索。
Here's the problem. How do I get to the nth- er, the k'th element in the list, in this case?
如何找到第n个元素呢-,在这里,如何找到第k个元素呢?
So I'm done when b minus k equals 1, or k equals b minus 1.
因此b-k=1或k-b=1的时候,我就可以停下来了。
Yeah. Actually, I think I want b minus k equal to 1. Right?
对,实际上,当b-k=1的时候就该停下来了对不对?
应用推荐