东莞市建设网站,网站开发 去哪里找页面,网站开发的付款方式,wordpress获取五条数据大家好#xff0c;我是苏貝#xff0c;本篇博客带大家刷题#xff0c;如果你觉得我写的还不错的话#xff0c;可以给我一个赞#x1f44d;吗#xff0c;感谢❤️ 点击查看题目 思路: struct ListNode *getIntersectionNode(struct ListNode *headA, struct ListNode *he… 大家好我是苏貝本篇博客带大家刷题如果你觉得我写的还不错的话可以给我一个赞吗感谢❤️ 点击查看题目 思路: struct ListNode *getIntersectionNode(struct ListNode *headA, struct ListNode *headB) {struct ListNode *cur1headA;struct ListNode *cur2headB;int len11;int len21;//1.找到两个链表的最后一个节点while(cur1-next){cur1cur1-next;len1;} while(cur2-next){cur2cur2-next;len2;}//2.比较这两个最后节点的地址如果相同即存在相交节点不同则不存在if(cur1!cur2){return NULL;}//3.让长的链表先走差距步struct ListNode *LongListheadA;struct ListNode *ShortListheadB;if(len1len2){LongListheadB;ShortListheadA;}int lenabs(len1-len2);//求绝对值while(len--){LongListLongList-next;}//一起走while(LongList!ShortList){LongListLongList-next;ShortListShortList-next;}return LongList;}好了那么本篇博客就到此结束了如果你觉得本篇博客对你有些帮助可以给个大大的赞吗感谢看到这里我们下篇博客见❤️