mirror of
https://github.com/Snailclimb/JavaGuide
synced 2025-08-01 16:28:03 +08:00
希尔排序的空间复杂度有误
希尔排序的空间复杂度应该是O(1)吧,并没有用到额外的空间,都是在原数组上进行操作。
This commit is contained in:
parent
8379c0bf77
commit
e68cb18e35
@ -259,7 +259,7 @@ public static int[] shellSort(int[] arr) {
|
||||
|
||||
- **稳定性**:稳定
|
||||
- **时间复杂度** :最佳:O(nlogn), 最差:O(n2) 平均:O(nlogn)
|
||||
- **空间复杂度** :`O(n)`
|
||||
- **空间复杂度** :`O(1)`
|
||||
|
||||
## 归并排序 (Merge Sort)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user