每日LeetCode - 160. 相交链表(C语言)

2021-09-10 19:12

阅读:805

标签:init   null   com   div   str   image   link   class   ada      C语言 #define NULL ((void *)0) // Definition for singly-linked list. struct ListNode { int val; struct ListNode *next; }; struct ListNode *getIntersectionNode(struct ListNode *headA, struct ListNode *headB) { if (headA == NULL || headB == NULL) return NULL; struct ListNode *pA = headA, *pB = headB; while (pA != pB) { pA = pA == NULL ? headB : pA->next; pB = pB == NULL ? headA : pB->next; } return pA; }  每日LeetCode - 160. 相交链表(C语言)标签:init   null   com   div   str   image   link   class   ada   原文地址:https://www.cnblogs.com/vicky2021/p/14902729.html


评论


亲,登录后才可以留言!