链表
共 15 篇文章
leetcode146. LRU 缓存
题目 题解 class LRUCache { private: int capacity; list<pair<int,int>>cache; unordered_map<int,list<pair<int,int>>::iterator> mp; public: L
leetcode148. 排序链表
题目 题解 搬移官方题解 /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode() : val(0), next(nu
leetcode23. 合并 K 个升序链表
暂无摘要...
leetcode147. 对链表进行插入排序
暂无摘要...
leetcode143. 重排链表
class Solution {public: void reorderList(ListNode* head) { if(!head)return ; vector<ListNode*>v; ListNode*cur=head;
leetcode141. 环形链表
暂无摘要...
leetcode138. 复制带随机指针的链表
暂无摘要...
leetcode142. 环形链表 II
哈希/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * };
leetcode160. 相交链表
暂无摘要...
leetcode92. 反转链表 II
暂无摘要...