上一页 1 2 3 4 5 6 7 ··· 11 下一页
摘要: java实现数组顺序存储二叉树遍历 二叉树类 class ArrBinaryTree { private int[] arr; public ArrBinaryTree(int[] arr) { this.arr = arr; } /** * 重载,方便使用 */ public void preOr 阅读全文
posted @ 2022-04-18 16:16 CoderCatIce 阅读(81) 评论(0) 推荐(0) 编辑
摘要: java实现二叉树删除节点 仅展示新增方法,全代码见前一章 节点类中 /** * 删除节点 * * @param id 需要删除节点的id */ public void delete(int id) { if (this.left != null && this.left.id == id) { t 阅读全文
posted @ 2022-04-18 15:48 CoderCatIce 阅读(115) 评论(0) 推荐(0) 编辑
摘要: java实现二叉树查找 节点类 /** * 节点类 */ class Node { private int id; private Node left; private Node right; /** * 前序查找 * * @param id 需要被寻找的id */ public Node preS 阅读全文
posted @ 2022-04-17 16:09 CoderCatIce 阅读(76) 评论(0) 推荐(0) 编辑
摘要: java实现二叉树的遍历 节点类 /** * 节点类 */ class Node { private int id; private Node left; private Node right; /** * 前序遍历的方法 */ public void preOrder() { // 先输出该节点 阅读全文
posted @ 2022-04-16 22:29 CoderCatIce 阅读(74) 评论(0) 推荐(0) 编辑
摘要: SpringBoot自动配置原理 @SpringBootApplication 这个注解是以下三个注解的合成注解 @SpringBootConfiguration @EnableAutoConfiguration @ComponentScan( excludeFilters = {@Filter( 阅读全文
posted @ 2022-04-16 16:20 CoderCatIce 阅读(32) 评论(0) 推荐(0) 编辑
摘要: Spring注解开发 注册组件 @Configuration中配置@Bean注册组件 实体类 public class User { private int id; private String name; @Override public String toString() { return "U 阅读全文
posted @ 2022-04-06 21:23 CoderCatIce 阅读(17) 评论(0) 推荐(0) 编辑
摘要: java实现hashTable 节点类 // 链表的节点 class Node { public int id; public String name; public Node pre; public Node next; @Override public String toString() { r 阅读全文
posted @ 2022-04-06 17:03 CoderCatIce 阅读(115) 评论(0) 推荐(0) 编辑
摘要: java常用查找算法 线性查找 /** * 找到一个就返回 * @param arr 数组 * @param value 需要找的数 * @return 找的数的下标,没找到为-1 */ public static int seqSearch(int[] arr, int value) { for 阅读全文
posted @ 2022-04-06 15:20 CoderCatIce 阅读(75) 评论(0) 推荐(0) 编辑
摘要: java常用排序算法 冒泡排序 public static void bubble(int[] arr) { int tem; for (int i = 1; i < arr.length; ++i) { // 负辅助变量,用于提前结束 int count = 0; for (int j = 1; 阅读全文
posted @ 2022-04-02 22:34 CoderCatIce 阅读(29) 评论(0) 推荐(0) 编辑
摘要: java实现八皇后问题 代码实现 public class Demo { int max = 8; int[] arr = new int[max]; static int count = 0; public static void main(String[] args) { Demo demo = 阅读全文
posted @ 2022-03-30 16:07 CoderCatIce 阅读(65) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 ··· 11 下一页