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 10c4cca commit a5d1ccfCopy full SHA for a5d1ccf
sort/src/main/java/com/mistray/insertion/Insertion.java
@@ -6,6 +6,9 @@
6
* @author MistRay
7
* @create 2018-11-16
8
* @desc 插入排序
9
+ * 逻辑:
10
+ * 相当于将一个无序数组,拆成两个数组,其中一个有序另一个无序,数组a元素数量开始为1,数组b元素数量为n-1
11
+ * 然后将数组b的元素依次有序添加到数组a中,最后数组b的元素会为0,数组a的元素数为n,最后数组a会完全有序
12
* 时间复杂度:
13
* 平均情况:O(n^2)
14
* 最好情况:O(n)
0 commit comments