Linked List
WX_ming
写代码就像写作文一样,思路要明确,方法要对,否则又臭又长还出错
展开
-
LeetCode 142. Linked List Cycle II C++
142. Linked List Cycle II Given a linked list, return the node where the cycle begins. If there is no cycle, return null. Note: Do not modify the linked list. Follow up: Can you solve it without u...原创 2018-08-23 20:55:27 · 294 阅读 · 0 评论 -
LeetCode Reverse Linked List C++
206. Reverse Linked List Reverse a singly linked list. Example: Input: 1->2->3->4->5->NULL Output: 5->4->3->2->1->NULL Follow up: A linked list can be reversed eit...原创 2018-08-23 22:36:35 · 254 阅读 · 0 评论 -
LeetCode 148. Sort List C++
148. Sort List Sort a linked list in O(n log n) time using constant space complexity. Example 1: Input: 4->2->1->3 Output: 1->2->3->4 Example 2: Input: -1->5->3->4-...原创 2018-08-24 10:25:28 · 138 阅读 · 0 评论