题解

本题关键:
a+c+b=b+c+a
// 243 h160 相交链表
public ListNode getIntersectionNode(ListNode headA, ListNode headB) {
ListNode pointA=headA,pointB=headB;
int rount=2;
while (rount>0){
if (pointA==pointB){
return pointA;
}
pointA=pointA.next;
pointB=pointB.next;
if (pointA==null){
pointA=headB;
rount--;
}
if (pointB==null){
pointB=headA;
}
}
return null;
}

![[附源码]计算机毕业设计JAVA恒星学院网络计费系统](https://img-blog.csdnimg.cn/b9809fa68ad5448f81f50c10cfb41bc8.png)
















