摘要: 可以分为链表是否有环来拆分问题 package dayone.tre; public class IntersectNode { public static Node getIntersectNode(Node head1, Node head2) { if (head1 == null || he 阅读全文
posted @ 2023-01-27 17:41 KeepSmiling_me 阅读(27) 评论(0) 推荐(0)
摘要: package dayone.tre; import java.util.Stack; public class PreorderTraversal { /*** * 先序遍历非递归写法 * @param head */ public static void preorderTraversal(No 阅读全文
posted @ 2023-01-27 16:27 KeepSmiling_me 阅读(21) 评论(0) 推荐(0)
摘要: package dayone.tre; /*** * o1和o2为head二叉树中的点,找出o1和02的最近公共祖先 */ public class Test { public static Node lowestAncestor(Node head, Node o1, Node o2) { //情 阅读全文
posted @ 2023-01-27 15:53 KeepSmiling_me 阅读(15) 评论(0) 推荐(0)