上一页 1 ··· 29 30 31 32 33 34 35 36 37 ··· 81 下一页
摘要: 参考: https://blog.csdn.net/ii19910410/article/details/90031310 https://www.cnblogs.com/james-roger/p/13183661.html https://www.cnblogs.com/jpfss/p/1143 阅读全文
posted @ 2021-10-09 08:59 Mars.wang 阅读(1811) 评论(0) 推荐(0)
摘要: java实现二叉查找树 public class BinarySortTree<K extends Comparable<K>, V> { public BinaryNode<K, V> getRoot() { return root; } public void setRoot(BinaryNod 阅读全文
posted @ 2021-10-08 14:10 Mars.wang 阅读(61) 评论(0) 推荐(0)
摘要: java二叉树遍历,最复杂的是非递归的后序遍历 import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; import java.util.LinkedList; public cla 阅读全文
posted @ 2021-10-06 21:49 Mars.wang 阅读(192) 评论(0) 推荐(0)
摘要: 一、栈 /** * 自定义栈:后进先出 */ public class Stack<T> { private final int length=10; private final Object[] entry = new Object[length]; private int top = -1; / 阅读全文
posted @ 2021-10-05 16:41 Mars.wang 阅读(81) 评论(0) 推荐(0)
摘要: 参考:《算法导论》 @Data @AllArgsConstructor public class WeightGraph { //节点名,前驱节点,最短路径 private List<Node<String,String,Integer>> nodes; //节点名,连接节点索引,边权重 priva 阅读全文
posted @ 2021-10-04 16:00 Mars.wang 阅读(399) 评论(0) 推荐(0)
摘要: java实现图的广度优先遍历和深度优先遍历 /** * 图的广度优先遍历和深度优先遍历 */ @Data @AllArgsConstructor @NoArgsConstructor public class GraphBFS { private List<Node> nodes; private 阅读全文
posted @ 2021-10-03 13:49 Mars.wang 阅读(309) 评论(0) 推荐(0)
摘要: @Data @AllArgsConstructor @NoArgsConstructor public class Graph { private Set<String> nodes; private List<Pair<String, String>> table; public void rem 阅读全文
posted @ 2021-10-03 10:06 Mars.wang 阅读(371) 评论(0) 推荐(0)
摘要: 转载:https://www.cnblogs.com/moongeek/p/12831296.html Collection JDK ImmutableCollection List JDK ImmutableList Set JDK ImmutableSet SortedSet/Navigable 阅读全文
posted @ 2021-10-02 17:06 Mars.wang 阅读(131) 评论(0) 推荐(0)
摘要: 图的连通性的概念: 连通无向图:如果无向图任意两个顶点都连通,则称为连通无向图连通有向图:如果有向图任意两个顶点vi,vj,从vi到vj和从vj到vi都有路径,则称有向图是强连通有向图 public class Connect { public static void main(String[] a 阅读全文
posted @ 2021-10-01 18:31 Mars.wang 阅读(618) 评论(0) 推荐(0)
摘要: 参考: https://blog.csdn.net/lezg_bkbj/article/details/11299335 还是上一篇的图 /** * @Author : * @Date : 2021/9/30 16:16 * @Description: 判断一个图是否存在回路 * 方法1:利用减枝的 阅读全文
posted @ 2021-09-30 17:16 Mars.wang 阅读(195) 评论(0) 推荐(0)
上一页 1 ··· 29 30 31 32 33 34 35 36 37 ··· 81 下一页