摘要:
![image](https://img2020.cnblogs.com/blog/2138338/202112/2138338-20211213233630764-1130067475.png) 阅读全文
摘要:
https://leetcode-cn.com/problems/valid-parentheses/ 阅读全文
摘要:
哈希表 遍历将结点存储在哈希表中,如果遇到环的入口,会检测到 public class Solution { public boolean hasCycle(ListNode head) { Set<ListNode> seen = new HashSet<ListNode>(); while (h 阅读全文
摘要:
链表 反转链表 https://leetcode-cn.com/problems/fan-zhuan-lian-biao-lcof/ https://www.cnblogs.com/zhbeii/p/15422709.html 两两交换相邻 https://leetcode-cn.com/probl 阅读全文
摘要:
使用递归 使用的这个递归又把我弄糊涂了,只能是暂时理解这4个,如果把他想成一个整体的话,有head、next,还有一个后续的结点,前面还是有一个 class Solution { public ListNode swapPairs(ListNode head) { if(head == null | 阅读全文
摘要:
遍历路径 遍历两个结点向上的路径,看第一个重合的结点 遍历全部 遍历整个树, class Solution { public TreeNode lowestCommonAncestor(TreeNode root, TreeNode p, TreeNode q) { while(root != nu 阅读全文