1
0
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:
Guide 2023-06-11 19:16:20 +08:00
parent c0765af4b2
commit 9408ee1241

View File

@ -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)