随笔分类 -  online judge:LeetCode--链表

摘要:/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ class Solu 阅读全文
posted @ 2020-02-23 14:07 douzujun 阅读(131) 评论(0) 推荐(0) 编辑
摘要:#include using namespace std; struct ListNode { int val; ListNode *next; ListNode(int x) : val(x), next(NULL) {} }; class Solution { public: ListNode* reverseBetween(ListNode* head... 阅读全文
posted @ 2019-04-16 00:46 douzujun 阅读(213) 评论(0) 推荐(0) 编辑
摘要:142. Linked List Cycle II 142. Linked List Cycle II Given a linked list, return the node where the cycle begins. If there is no cycle, return null. To 阅读全文
posted @ 2019-04-05 00:44 douzujun 阅读(242) 评论(0) 推荐(0) 编辑
摘要:141. Linked List Cycle 141. Linked List Cycle Given a linked list, determine if it has a cycle in it. To represent a cycle in the given linked list, w 阅读全文
posted @ 2019-04-01 21:59 douzujun 阅读(193) 评论(0) 推荐(0) 编辑
摘要:143. Reorder List Given a singly linked list L: L0→L1→…→Ln-1→Ln,reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→… You may not modify the values in the list's nod 阅读全文
posted @ 2019-03-31 23:41 douzujun 阅读(159) 评论(0) 推荐(0) 编辑
摘要:148. Sort List 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 E 阅读全文
posted @ 2019-03-30 20:42 douzujun 阅读(133) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示