摘要:
// 获取相交节点 public static Node getNode(Node head1, Node head2) { if (head1 == null || head2 == null) { return null; } // 获取第一个链表的入环节点 Node loop1 = getLo 阅读全文
摘要:
public static Node getLoopNode(Node head){ if(head == null || head.next == null){ return null; } // 快慢指针,快指针一定会遇到慢指针 Node n1 = head.next; Node n2 = he 阅读全文
摘要:
制作中。。。 阅读全文
摘要:
方法1 栈 使用出栈入栈的方法,如果是回文结构,则出栈入栈的顺序肯定一致。 时间复杂度:O(N) 空间复杂度:O(N) public static boolean isPalindrome(Node head) { Stack<Node> stack = new Stack<>(); Node cu 阅读全文