For example, the following two linked lists:
A: a1 → a2
↘
c1 → c2 → c3
↗
B: b1 → b2 → b3
begin to intersect at node c1.
想复杂了,题目默认只要找到了intersection的开始 后面一定都是intersect的。
注意java里面所有东西都是指针,声明指针就像声明变量。
就像总结里面的two pointers类型题,首先计算长度,然后通过指针将两个list对齐,然后再进行判断。

本文探讨了如何解决两个链表相交的问题,通过计算链表长度并调整指针位置来寻找交集起始节点的方法。
1087

被折叠的 条评论
为什么被折叠?



