07 2021 档案

摘要: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 朱在春 阅读(41) 评论(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 朱在春 阅读(32) 评论(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 朱在春 阅读(41) 评论(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 朱在春 阅读(41) 评论(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 朱在春 阅读(116) 评论(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 朱在春 阅读(31) 评论(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 朱在春 阅读(90) 评论(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 朱在春 阅读(177) 评论(0) 推荐(0) 编辑
摘要:package A;public class JosePhu { public static void main(String[] args) { String expression="300+2*6-2"; //你可以画两个表示栈的图 ArrayStack numStack=new ArraySt 阅读全文
posted @ 2021-07-26 11:42 朱在春 阅读(92) 评论(0) 推荐(0) 编辑
摘要:package A;import java.util.Scanner;public class JosePhu { public static void main(String[] args) { ArrayStack arrayStack = new ArrayStack(3); boolean 阅读全文
posted @ 2021-07-26 00:16 朱在春 阅读(72) 评论(0) 推荐(0) 编辑
摘要:package A;public class Josephu { public static void main(String[] args) { Manage1 manage1=new Manage1(); manage1.addBox(5); manage1.showBox(); manage1 阅读全文
posted @ 2021-07-25 10:22 朱在春 阅读(41) 评论(0) 推荐(0) 编辑
摘要:package A;import java.util.Stack;public class Manage1 { Box head=new Box(0,""); public void add(Box box){//增 Box temp=head; while (true){ if (temp.nex 阅读全文
posted @ 2021-07-23 12:37 朱在春 阅读(42) 评论(0) 推荐(0) 编辑
摘要:/* * 盒子类 * 其中box你可以理解为一个大盒子里面包裹着一个小盒子,或者将box理解为一个箭头 * 这里我更喜欢理解为那种礼品包装盒,一个大盒子里面包裹着一个小盒子,然后这个小盒子里面又包裹着一个小盒子, * 如此循环往复下去(数据量足够多的情况下) * */ public class Bo 阅读全文
posted @ 2021-07-23 10:29 朱在春 阅读(38) 评论(1) 推荐(0) 编辑

点击右上角即可分享
微信分享提示