展开
拓展 关闭
订阅号推广码
GitHub
视频
公告栏 关闭

合集-编程思维方式

摘要:打印等腰三角形 第1次推导 public class test { public static void main(String[] args) { // 行数 int a = 3; System.out.println(); System.out.print(" "); System.out.pr 阅读全文
posted @ 2023-09-29 14:15 DogLeftover 阅读(20) 评论(0) 推荐(0) 编辑
摘要:必须是1个有序的数组 第1次推导 public class test { public static void main(String[] args) { int[] ints = {1,2,3,5,7,9}; int a = 6; // 要查找的数 int i=0; //起始位置 int j=in 阅读全文
posted @ 2023-09-29 14:35 DogLeftover 阅读(6) 评论(0) 推荐(0) 编辑
摘要:第1次推导 public class test { public static void main(String[] args) { int[] ints = {6, 5, 9, 5}; int tmp; if(ints[0]>ints[1]){ tmp = ints[0]; ints[0] = i 阅读全文
posted @ 2023-09-29 14:42 DogLeftover 阅读(6) 评论(0) 推荐(0) 编辑
摘要:第1次推导 public class test { public static void main(String[] args) { int[] ints = {2,5,3,1,8,9}; int tmp; // 存储临时变量 int j; // 开始比较第几位的数 // 第1次 // 2,5,3, 阅读全文
posted @ 2023-09-29 14:45 DogLeftover 阅读(6) 评论(0) 推荐(0) 编辑
摘要:数组降序的情况下插入数据依然是降序 第1次推导 public class test { public static void main(String[] args) { int[] ints = {90, 80, 70}; int tmp = 85; // 与第1个数比较时 // [0][1][2] 阅读全文
posted @ 2023-09-29 14:58 DogLeftover 阅读(26) 评论(0) 推荐(0) 编辑
摘要:创建节点类 public class Node { int n; Node next; } 第1次推导 public class test { public static void main(String[] args) { // 新建节点 Node node1 = new Node(); node 阅读全文
posted @ 2023-09-29 15:14 DogLeftover 阅读(33) 评论(0) 推荐(0) 编辑
摘要:创建节点类 public class Node { int n; Node next; } 第1次推导 public class test { public static void main(String[] args) { // 新建节点 Node node1 = new Node(); node 阅读全文
posted @ 2023-09-29 15:22 DogLeftover 阅读(17) 评论(0) 推荐(0) 编辑
摘要:编写方法 public class MyArrayList { private int[] n = new int[10]; //动态数组 private int size=0; // 长度 public int size(){ return this.size; } //添加一个元素 public 阅读全文
posted @ 2023-09-29 15:29 DogLeftover 阅读(9) 评论(0) 推荐(0) 编辑
摘要:创建节点类 public class Node { int n; Node next; } 编写方法 public class MyLinkList { Node head = new Node(); private int len=0; // 获取长度 public int size(){ ret 阅读全文
posted @ 2023-09-29 15:36 DogLeftover 阅读(11) 评论(0) 推荐(0) 编辑
摘要:使用数组模拟队列 案例1 public class Queue { private int[] num= new int[5]; private int len=0; public int size(){ return this.len; } //添加 public int add(int n){ 阅读全文
posted @ 2023-09-29 16:13 DogLeftover 阅读(6) 评论(0) 推荐(0) 编辑
摘要:使用链表模拟队列 案例1 // 创建节点类 public class Node { int n; Node next; } // 编写方法 public class Queue { Node head = new Node(); Node last = new Node(); private int 阅读全文
posted @ 2023-09-29 16:24 DogLeftover 阅读(17) 评论(0) 推荐(0) 编辑
摘要:编写实体类 public class Student { String name; // 姓名 String sex; // 性别 int sno; // 学号 int score; // 成绩 public String getName() { return name; } public void 阅读全文
posted @ 2023-09-29 17:26 DogLeftover 阅读(24) 评论(0) 推荐(0) 编辑
摘要:编写实体类 public class Student { String name; // 姓名 String sex; // 性别 int sno; // 学号 int score; // 成绩 public String getName() { return name; } public void 阅读全文
posted @ 2023-09-29 18:50 DogLeftover 阅读(12) 评论(0) 推荐(0) 编辑

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