直接插入排序、简单选择排序、冒泡排序、快速排序
1、直接插入排序空间复杂度:O(1)
时间复杂度:最优O(n),最坏O(n^2) ,平均O(n^2) 。
123456789101112131415161718192021222324252627282930/** * 直接插入排序:下一个数在插入前面的有序数列时排序 */public class Insertion { public static void main(String[] args) { int[] arr = {10, 9, 4, 8, 6, 7, 5, 3, 2, 1}; insertSort(arr); System.out.println(Arrays.toString(arr)); } public static void insertSort(int[] arr) { for (int i = 1; i < arr.length; i++) { //当前插入的数 int temp = ...
Spring-boot项目部署到tomcat容器中
1、打包形式改为war包pom.xml中设置
1<packaging>war</packaging>
2、移除内嵌的tomcat
1234567891011<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> <!-- 移除嵌入式tomcat插件 --> <exclusions> <exclusion> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-tomcat</artifactId> </exclusion> </exclusion ...




