会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
卖程序的小歪
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
35
36
37
38
39
40
41
42
43
···
46
下一页
2014年4月23日
LeetCode Path Sum II
摘要: class Solution {private: vector > result;public: vector > pathSum(TreeNode *root, int sum) { result.clear(); vector path; d...
阅读全文
posted @ 2014-04-23 22:05 卖程序的小歪
阅读(175)
评论(0)
推荐(0)
2014年4月22日
LeetCode Single Number II
摘要: class Solution {public: int singleNumber(int A[], int n) { sort(A, A+n); int last = A[0]; int time = 1; for (int i=1; i...
阅读全文
posted @ 2014-04-22 22:18 卖程序的小歪
阅读(143)
评论(0)
推荐(0)
LeetCode Single Number
摘要: class Solution {public: int singleNumber(int A[], int n) { int tmp = A[0]; for (int i=1; i<n; i++) { tmp ^= A[i]; }...
阅读全文
posted @ 2014-04-22 21:55 卖程序的小歪
阅读(164)
评论(0)
推荐(0)
Leetcode Populating Next Right Pointers in Each Node
摘要: class Solution {public: void connect(TreeLinkNode *root) { dfs(root, NULL); } void dfs(TreeLinkNode* root, TreeLinkNode* counter_p...
阅读全文
posted @ 2014-04-22 21:45 卖程序的小歪
阅读(211)
评论(0)
推荐(0)
LeetCode Permutations
摘要: class Solution {private: vector > result;public: vector > permute(vector &num) { result.clear(); dfs(num, 0); return result...
阅读全文
posted @ 2014-04-22 00:05 卖程序的小歪
阅读(114)
评论(0)
推荐(0)
2014年4月21日
Leetcode Sum Root to Leaf Numbers
摘要: class Solution {private: int sum;public: int sumNumbers(TreeNode *root) { sum = 0; dfs(root, 0); return sum; } vo...
阅读全文
posted @ 2014-04-21 23:19 卖程序的小歪
阅读(135)
评论(0)
推荐(0)
2014年4月18日
LeetCode Candy
摘要: typedef pair P;class Solution {public: int _candy(vector &ratings) { int len = ratings.size(); if (len == 0) return 0; ...
阅读全文
posted @ 2014-04-18 11:18 卖程序的小歪
阅读(188)
评论(0)
推荐(0)
2014年4月17日
LeetCode Sort List
摘要: class Solution {public: ListNode *sortList(ListNode *head) { if (head == NULL || head->next == NULL) return head; ListNode *h1 = NULL...
阅读全文
posted @ 2014-04-17 21:06 卖程序的小歪
阅读(167)
评论(0)
推荐(0)
LeetCode Remove Duplicates from Sorted List II
摘要: class Solution {public: ListNode *deleteDuplicates(ListNode *head) { if (head == NULL || head->next == NULL) return head; Lis...
阅读全文
posted @ 2014-04-17 20:23 卖程序的小歪
阅读(123)
评论(0)
推荐(0)
LeetCode Remove Duplicates from Sorted List
摘要: class Solution {public: ListNode *deleteDuplicates(ListNode *head) { if (head == NULL) return NULL; ListNode *pre, *cur, *tmp; ...
阅读全文
posted @ 2014-04-17 19:31 卖程序的小歪
阅读(139)
评论(0)
推荐(0)
上一页
1
···
35
36
37
38
39
40
41
42
43
···
46
下一页
公告