LeetCode Reorder List
摘要:struct ListNode { int val; ListNode *next; ListNode(int x) : val(x), next(NULL) {} }; class Solution { public: void reorderList(ListNode* head) { if(head == nullptr) return; int size = 0; ...
阅读全文
LeetCode Rotate List
摘要:struct ListNode { int val; ListNode *next; ListNode(int x) : val(x), next(NULL) {} }; class Solution { public: ListNode* rotateRight(ListNode* head, int k) { int level = -1;...
阅读全文