We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 36897de commit 6516bb8Copy full SHA for 6516bb8
1.bubbleSort.md
@@ -35,7 +35,7 @@
35
36
设初始文件是反序的,需要进行 n-1 趟排序。每趟排序要进行 n-i 次关键字的比较(1≤i≤n-1),且每次比较都必须移动记录三次来达到交换记录位置。在这种情况下,比较和移动次数均达到最大值:
37
38
-$$ 比较:C_{max} = \frac{n(n-1)}{2} = O(n^2)$$
+$$ 比较:C_{max} = \frac{n(n-1)}{2} = O(n^2)$$
39
$$ 移动:M_{max} = \frac{3n(n-1)}{2} = O(n^2)$$
40
41
冒泡排序的最坏时间复杂度为$$ O(n^2)$$。
0 commit comments