Skip to content

Commit e68cb18

Browse files
authored
希尔排序的空间复杂度有误
希尔排序的空间复杂度应该是O(1)吧,并没有用到额外的空间,都是在原数组上进行操作。
1 parent 8379c0b commit e68cb18

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/cs-basics/algorithms/10-classical-sorting-algorithms.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ public static int[] shellSort(int[] arr) {
259259

260260
- **稳定性**:稳定
261261
- **时间复杂度** :最佳:O(nlogn), 最差:O(n2) 平均:O(nlogn)
262-
- **空间复杂度**`O(n)`
262+
- **空间复杂度**`O(1)`
263263

264264
## 归并排序 (Merge Sort)
265265

0 commit comments

Comments
 (0)