Using this notation, you should know that search through a list is O(n) and binary search (through a sorted list) is log(n).
看到这个标记你就应该知道搜索链表的复杂度为O(n),进行二进制搜索时(已排序)的空间复杂度为log(n)。
If you access elements by index, a linked list is not a good solution: you have to traverse the list from the beginning, so it is an o (n) operation.
如果你访问元素的索引,一个链表是不是一个好办法:你必须遍历列表的开始,所以这是一个O (n)的操作。
Creating rural jobs is on everyone's to-do list, from the government to the U-N to aid groups.
VOA: standard.2010.03.30
So if I start off with a list of length n, how many times can I divide it by 2, until I get to something no more than two left?
我能够除以多少次2呢?,直到我得到的长度不超过2么?,对数次,对吧?就像刚才那位同学说的那样?
And we said that was log rhythmic, took log n time where n is the size of the list.
当列表的长度为n的时候,整个算法耗时log,n的时间。
应用推荐