摘要: 160.相交链表 编写一个程序,找到两个单链表相交的起始节点。 如下面的两个链表: 在节点 c1 开始相交。 示例 1: 输入:intersectVal = 8, listA = [4,1,8,4,5], listB = [5,0,1,8,4,5], skipA = 2, skipB = 3 输出: 阅读全文
posted @ 2020-03-20 10:01 一二三的三二一 阅读(103) 评论(0) 推荐(0)
摘要: 1 #include"iostream" 2 using namespace std; 3 struct ListNode { 4 int val; 5 ListNode* next; 6 ListNode(int x) : val(x), next(NULL) {} 7 }; 8 9 class 阅读全文
posted @ 2020-03-19 12:02 一二三的三二一 阅读(149) 评论(0) 推荐(0)