When you are searching a list to see whether it has an element, you don't randomly probe the list, hoping to find whether or not it's there.
当我们在一个数组中,寻找目标元素的时候,我们不会随机的调查数组来看。
Lisp The problem with that technique, while it's very general, is how long does it take me to find the i'th element of the list?
很多编程语言包括,都是用了这种技术,这个问题就是,当数组很大的时候?
And when we begin to speak about the human being and human dignity, people with religious identification quickly find themselves talking about concepts that have an element of sacred to them.
当我们开始谈论人类,和人的尊严,信仰宗教的人,很快会发现自己在谈论那些,对他们有着神圣意义的概念。
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.
线性的!因为我得从头,向下走一步步走,所以这里是线性访问,哦,有问题了吧。
I've got to count my way down, which means that the access would be linear in the length of the list to find the i'th element of the list, and that's going to increase the complexity.
的位置并去访问,然后继续下去,也就意味着,找到数组中的第i个元素的方法,是关于数组的长度呈线性复杂度的,这回增加算法的复杂度。
应用推荐