1
0
mirror of https://github.com/Snailclimb/JavaGuide synced 2025-08-01 16:28:03 +08:00

希尔排序的空间复杂度有误

希尔排序的空间复杂度应该是O(1)吧,并没有用到额外的空间,都是在原数组上进行操作。
This commit is contained in:
chensiquan 2022-09-22 15:40:30 +08:00 committed by GitHub
parent 8379c0bf77
commit e68cb18e35
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -259,7 +259,7 @@ public static int[] shellSort(int[] arr) {
- **稳定性**:稳定
- **时间复杂度** 最佳O(nlogn) 最差O(n2) 平均O(nlogn)
- **空间复杂度** `O(n)`
- **空间复杂度** `O(1)`
## 归并排序 (Merge Sort)