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)的操作。
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)的操作。
应用推荐