We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents a167895 + 73bf1a9 commit 2f08555Copy full SHA for 2f08555
MD/LinkedList.md
@@ -56,9 +56,12 @@
56
57
由此可以看出是使用二分查找来看 `index` 离 size 中间距离来判断是从头结点正序查还是从尾节点倒序查。
58
59
-这样的效率是非常低的,特别是当 index 距离 size 的中间位置越远时。
+- `node()`会以`O(n/2)`的性能去获取一个结点
60
+ - 如果索引值大于链表大小的一半,那么将从尾结点开始遍历
61
+
62
+这样的效率是非常低的,特别是当 index 越接近 size 的中间值时。
63
64
总结:
65
66
- LinkedList 插入,删除都是移动指针效率很高。
-- 查找需要进行遍历查询,效率较低。
67
+- 查找需要进行遍历查询,效率较低。
0 commit comments