摘要:
考察链表的操作,合并两个有序链表,合并后的链表仍是有序的。 C++版 #include <iostream> #include <algorithm> using namespace std; // 定义链表 struct ListNode{ int val; struct ListNode* ne 阅读全文
posted @ 2020-07-25 19:37
程序员曾奈斯
阅读(105)
评论(0)
推荐(0)
摘要:
考察链表的操作,将单向链表反转,返回头节点。 C++版 #include <iostream> #include <algorithm> using namespace std; // 定义链表 struct ListNode{ int val; struct ListNode* next; Lis 阅读全文
posted @ 2020-07-25 19:20
程序员曾奈斯
阅读(109)
评论(0)
推荐(0)
摘要:
考察链表的操作,找到单向链表中环的入口节点 C++版 #include <iostream> #include <algorithm> using namespace std; // 定义链表 struct ListNode{ int val; struct ListNode* next; List 阅读全文
posted @ 2020-07-25 18:39
程序员曾奈斯
阅读(122)
评论(0)
推荐(0)
摘要:
考察链表的操作,注意使用一次遍历。相关题目:求链表的中间节点。 C++版 #include <iostream> #include <algorithm> using namespace std; // 定义链表 struct ListNode{ int val; struct ListNode* 阅读全文
posted @ 2020-07-25 16:23
程序员曾奈斯
阅读(99)
评论(0)
推荐(0)

浙公网安备 33010602011771号