mirror of
https://github.com/Snailclimb/JavaGuide
synced 2025-06-20 22:17:09 +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) 。
|
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)`
|
- **空间复杂度**:`O(1)`
|
||||||
|
|
||||||
## 归并排序 (Merge Sort)
|
## 归并排序 (Merge Sort)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user