多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
> 时间复杂度O(n^2),辅助空间O(1),稳定 ```java public static <T extends Comparable> void insertSort(T[] a) { insertSort(a, 0, a.length); } public static <T extends Comparable> void insertSort(T[] a, int low, int high) { for (int i = low + 1; i < high; i++) { for (int j = i; j > 0 && less(a[j], a[j - 1]); j--) { swap(a, j, j - 1); } } } ```