上一页 1 ··· 35 36 37 38 39 40 41 42 43 ··· 46 下一页
摘要: class Solution {private: vector > result;public: vector > pathSum(TreeNode *root, int sum) { result.clear(); vector path; d... 阅读全文
posted @ 2014-04-23 22:05 卖程序的小歪 阅读(167) 评论(0) 推荐(0) 编辑
摘要: 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 卖程序的小歪 阅读(138) 评论(0) 推荐(0) 编辑
摘要: 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 卖程序的小歪 阅读(161) 评论(0) 推荐(0) 编辑
摘要: class Solution {public: void connect(TreeLinkNode *root) { dfs(root, NULL); } void dfs(TreeLinkNode* root, TreeLinkNode* counter_p... 阅读全文
posted @ 2014-04-22 21:45 卖程序的小歪 阅读(205) 评论(0) 推荐(0) 编辑
摘要: class Solution {private: vector > result;public: vector > permute(vector &num) { result.clear(); dfs(num, 0); return result... 阅读全文
posted @ 2014-04-22 00:05 卖程序的小歪 阅读(109) 评论(0) 推荐(0) 编辑
摘要: class Solution {private: int sum;public: int sumNumbers(TreeNode *root) { sum = 0; dfs(root, 0); return sum; } vo... 阅读全文
posted @ 2014-04-21 23:19 卖程序的小歪 阅读(125) 评论(0) 推荐(0) 编辑
摘要: 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 卖程序的小歪 阅读(178) 评论(0) 推荐(0) 编辑
摘要: class Solution {public: ListNode *sortList(ListNode *head) { if (head == NULL || head->next == NULL) return head; ListNode *h1 = NULL... 阅读全文
posted @ 2014-04-17 21:06 卖程序的小歪 阅读(162) 评论(0) 推荐(0) 编辑
摘要: class Solution {public: ListNode *deleteDuplicates(ListNode *head) { if (head == NULL || head->next == NULL) return head; Lis... 阅读全文
posted @ 2014-04-17 20:23 卖程序的小歪 阅读(115) 评论(0) 推荐(0) 编辑
摘要: class Solution {public: ListNode *deleteDuplicates(ListNode *head) { if (head == NULL) return NULL; ListNode *pre, *cur, *tmp; ... 阅读全文
posted @ 2014-04-17 19:31 卖程序的小歪 阅读(127) 评论(0) 推荐(0) 编辑
上一页 1 ··· 35 36 37 38 39 40 41 42 43 ··· 46 下一页