摘要: package A;import java.text.SimpleDateFormat;import java.util.Arrays;import java.util.Date;public class JosePhu { public static void main(String[] args 阅读全文
posted @ 2021-08-01 22:13 朱在春 阅读(34) 评论(0) 推荐(0) 编辑
摘要: package A;import java.text.SimpleDateFormat;import java.util.Arrays;import java.util.Date;public class JosePhu { public static void main(String[] args 阅读全文
posted @ 2021-08-01 09:50 朱在春 阅读(43) 评论(0) 推荐(0) 编辑
摘要: public class Method {//以下是希尔排序的两种实现方法 public void shellSort(int[] a) {//比较慢 /*//int[] a={5,9,4,2,1,10,7,8,3,6},假如十个数; int temp=0; for (int i = 5; i < 阅读全文
posted @ 2021-07-30 16:27 朱在春 阅读(38) 评论(0) 推荐(0) 编辑
摘要: public void insertSort(int[] a){ //5,4,3,2,1 //插入排序比选择排序慢一点 for (int i = 1; i < a.length; i++) { int insertVal=a[i]; int insertIndex=i-1;//要插入的这个数的前面一 阅读全文
posted @ 2021-07-29 14:16 朱在春 阅读(30) 评论(0) 推荐(0) 编辑
摘要: public void selectSort(int[] a){//其实选择排序比冒泡排序要快 /*int minIndex=0; int min=a[0]; for (int i = 0+1; i < a.length; i++) { if (min>a[i]){ min=a[i]; minInd 阅读全文
posted @ 2021-07-29 12:30 朱在春 阅读(36) 评论(0) 推荐(0) 编辑
摘要: package A;import java.text.SimpleDateFormat;import java.util.Date;public class JosePhu { public static void main(String[] args) { int[] a=new int[8000 阅读全文
posted @ 2021-07-29 10:43 朱在春 阅读(36) 评论(0) 推荐(0) 编辑
摘要: package A;public class JosePhu { public static void main(String[] args) {//听说八皇后问题面试经常问,能不能用贪心算法把它给优化一下? Method method=new Method(); method.check(0); 阅读全文
posted @ 2021-07-28 16:14 朱在春 阅读(114) 评论(0) 推荐(0) 编辑
摘要: package A;public class JosePhu { public static void main(String[] args) { ArrayStack arrayStack=new ArrayStack(); int[][] map=new int[8][7]; for(int i 阅读全文
posted @ 2021-07-27 22:57 朱在春 阅读(29) 评论(0) 推荐(0) 编辑
摘要: package A;import java.util.ArrayList;//此程序你可以验算你的逆波兰表达式有没有写对//4*5-8+60+8/2=4 5 * 8 - 60 + 8 2 / +//其实逆波兰表达式并不难,也是由我们常用的中缀表达式转换来的,仔细写一下就知道了public class 阅读全文
posted @ 2021-07-27 15:53 朱在春 阅读(80) 评论(0) 推荐(0) 编辑
摘要: package A;import java.util.ArrayList;//此程序你可以验算你的逆波兰表达式有没有写对//4*5-8+60+8/2=4 5 * 8 - 60 + 8 2 / +//其实逆波兰表达式并不难,也是由我们常用的中缀表达式转换来的,仔细写一下就知道了public class 阅读全文
posted @ 2021-07-26 16:01 朱在春 阅读(157) 评论(0) 推荐(0) 编辑