# Easy-题目38：160. Intersection of Two Linked Lists

Write a program to find the node at which the intersection of two singly linked lists begins.

For example, the following two linked lists:

A:          a1 → a2
↘
c1 → c2 → c3
↗
B:     b1 → b2 → b3

begin to intersect at node c1.

/**
* struct ListNode {
*     int val;
*     struct ListNode *next;
* };
*/
return NULL;
struct ListNode *p;
int lengtha,lengthb;

if(lengtha>lengthb) {
for(int i=0;i<lengtha-lengthb;i++)
}
else if (lengthb>lengtha) {
for(int i=0;i<lengthb-lengtha;i++)
}
}
}

32ms，beats 18.75%，众数32ms,78.91%
cmershen的碎碎念：

• 本文已收录于以下专栏：

Write a program to find the node at which the intersection of two singly linked lists begins.

## leetcode-160-Intersection of Two Linked Lists

Intersection of Two Linked Lists Write a program to find the node at which the intersection of two...

## LeetCode （160） Intersection of Two Linked Lists

• fly_yr
• 2015年11月13日 13:10
• 455

## [LeetCode]problem 160. Intersection of Two Linked Lists

TAG求两个无环链表第一个相交节点 题目链接方法MD智障啊。真是不服不行。编程之美上有一个基础的问题，只判断是否相交；然后后续有个问题就是如果需要找第一个相交节点该怎么办？当时我随便一想，觉得应该没有...

## Leetcode 160. Intersection of Two Linked Lists

160. Intersection of Two Linked Lists Total Accepted: 69072 Total Submissions: 228648 Difficulty:...

## 160 Intersection of Two Linked Lists 求两个链表的交点

Write a program to find the node at which the intersection of two singly linked lists begins.For exa...

## LeetCode OJ 160. Intersection of Two Linked Lists

LeetCode OJ 160. Intersection of Two Linked ListsDescriptionWrite a program to find the node at whic...

## Leetcode NO.160 Intersection of Two Linked Lists

举报原因： 您举报文章：Easy-题目38：160. Intersection of Two Linked Lists 色情 政治 抄袭 广告 招聘 骂人 其他 (最多只允许输入30个字)