mirror of
https://github.com/Snailclimb/JavaGuide
synced 2025-06-16 18:10:13 +08:00
Update 10-classical-sorting-algorithms.md
This commit is contained in:
parent
c0765af4b2
commit
9408ee1241
@ -27,7 +27,7 @@ tag:
|
||||
上图存在错误:
|
||||
|
||||
1. 插入排序的最好时间复杂度为 O(n) 而不是 O(n^2) 。
|
||||
2.
|
||||
2. 希尔排序的平均时间复杂度为 O(nlogn)
|
||||
|
||||
**图片名词解释:**
|
||||
|
||||
@ -263,7 +263,7 @@ public static int[] shellSort(int[] arr) {
|
||||
### 算法分析
|
||||
|
||||
- **稳定性**:不稳定
|
||||
- **时间复杂度**:最佳:O(nlogn), 最差:O(n2) 平均:O(nlogn)
|
||||
- **时间复杂度**:最佳:O(nlogn), 最差:O(n^2) 平均:O(nlogn)
|
||||
- **空间复杂度**:`O(1)`
|
||||
|
||||
## 归并排序 (Merge Sort)
|
||||
|
Loading…
x
Reference in New Issue
Block a user