随笔分类 - 数据结构
摘要:点击查看代码 #include<iostream> using namespace std; const int N = 1e5 + 10; int e[N], r[N], l[N]; int idx; void init() { r[0] = 1; l[1] = 0; idx = 2; } voi
阅读全文
摘要:点击查看代码 #include<iostream> using namespace std; const int N = 1e5 + 10; int head, idx; int e[N], ne[N]; void init() { head = -1; idx = 0; } void add_to
阅读全文
摘要:点击查看代码 class Solution { public: vector<int> findNumbersWithSum(vector<int>& nums, int target) { unordered_set<int> hash; for (int i = 0; i < nums.size
阅读全文
摘要:点击查看代码 /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ cla
阅读全文
摘要:点击查看代码 /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ cla
阅读全文
摘要:点击查看代码 /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ cla
阅读全文
摘要:迭代版本 点击查看代码 /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; *
阅读全文
摘要:点击查看代码 /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ cla
阅读全文
摘要:点击查看代码 /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ cla
阅读全文