Constant. Ooh, constant says, no matter what the length of the list is, I'm going to take the same amount of time.
这个算法用的时间是相同的,我不这么认为,如果我们创建一个十倍于以前大小的数组。
Remember we said we design lists so that the access, no matter where it was on the list was of constant time.
记住我们说过我们创建了,一个列表它就是这么访问的,无论它在列表的哪个位置。
Okay, so 1 is a viable answer in some contacts that needs constant time, the same amount of time no matter what.
在需要常量时间的情况下,答案是1,不管怎样,总时间是,相同的。
应用推荐