no neet to say any more 。。
public static ListNode GetIntersectionNode(ListNode headA, ListNode headB)
{
if (headA == null || headB == null)
return null;
ListNode currA = headA;
ListNode currB = headB;
while (currA!=currB)
{
currA = currA == null ? headB : currA.next;
currB = currB == null ? headA : currB.next;
}
return currA;
//int max = 0;
//ListNode list = headA;
//while (headA.next!=null)
//{
// int i = 0;
// while (headB.next!=null)
// {
// if (headB==headA)
// {
// headB = headB.next;
// i++;
// max= Math.Max(i, max);
// }
// }
//}
//return max;
}