Leetcode-Intersection of Two Linked Lists
2015-02-24 06:31
295 查看
For example, the following two linked lists:
begin to intersect at node c1.
想复杂了,题目默认只要找到了intersection的开始 后面一定都是intersect的。
注意java里面所有东西都是指针,声明指针就像声明变量。
就像总结里面的two pointers类型题,首先计算长度,然后通过指针将两个list对齐,然后再进行判断。
A: a1 → a2 ↘ c1 → c2 → c3 ↗ B: b1 → b2 → b3
begin to intersect at node c1.
想复杂了,题目默认只要找到了intersection的开始 后面一定都是intersect的。
注意java里面所有东西都是指针,声明指针就像声明变量。
就像总结里面的two pointers类型题,首先计算长度,然后通过指针将两个list对齐,然后再进行判断。
相关文章推荐
- [LeetCode]Intersection of Two Linked Lists
- 【leetcode 两个链表的交集点】Intersection of Two Linked Lists
- Leetcode_160_Intersection of Two Linked Lists
- Intersection of Two Linked Lists--leetcode
- 和大神们学习每天一题(leetcode)-Intersection of Two Linked Lists
- 【LeetCode】Intersection of Two Linked Lists
- LeetCode Intersection of Two Linked Lists
- leetcode: Intersection of Two Linked Lists
- LeetCode:Intersection of Two Linked Lists
- LeetCode Intersection of Two Linked Lists
- 【Leetcode】Intersection of Two Linked Lists in JAVA
- [Leetcode]Intersection of Two Linked Lists
- [Leetcode] Intersection of Two Linked Lists
- [leetcode]Intersection of Two Linked Lists —— 熟悉python
- leetcode:Intersection of Two Linked Lists
- [leetcode]Intersection of Two Linked Lists
- [LeetCode] Intersection of Two Linked Lists 两链表是否相交
- Leetcode: Intersection of Two Linked Lists
- Leetcode: Intersection of Two Linked Lists
- [leetCode] Intersection of Two Linked Lists