mirror of
https://github.com/krahets/hello-algo.git
synced 2026-08-11 19:30:59 +00:00
Add description of the comment format.
This commit is contained in:
@@ -466,7 +466,7 @@ $$
|
||||
|
||||
**空间复杂度 $O(1)$ :** 指针 `i` , `j` 使用常数大小空间。
|
||||
|
||||
## 优缺点
|
||||
## 优点与缺点
|
||||
|
||||
二分查找效率很高,体现在:
|
||||
|
||||
|
||||
@@ -185,7 +185,7 @@ comments: true
|
||||
|
||||
**空间复杂度:** $O(n)$ ,其中 $n$ 为数组或链表长度。
|
||||
|
||||
## 优缺点
|
||||
## 优点与缺点
|
||||
|
||||
在哈希表中,**查找、插入、删除操作的平均时间复杂度都为 $O(1)$** ,这意味着无论是高频增删还是高频查找场景,哈希查找的性能表现都非常好。当然,一切的前提是保证哈希表未退化。
|
||||
|
||||
|
||||
@@ -244,7 +244,7 @@ comments: true
|
||||
|
||||
**空间复杂度 $O(1)$ :** 无需使用额外空间。
|
||||
|
||||
## 优缺点
|
||||
## 优点与缺点
|
||||
|
||||
**线性查找的通用性极佳。** 由于线性查找是依次访问元素的,即没有跳跃访问元素,因此数组或链表皆适用。
|
||||
|
||||
|
||||
Reference in New Issue
Block a user