上一页 1 2 3 4 5 6 7 8 ··· 21 下一页
摘要: ```C++ class Solution { public: void recur(TreeNode* root, const int expectNumber, int curr, vector>& res, vector& path){ path.push_back(root->val); curr += root->val; bool... 阅读全文
posted @ 2018-09-02 20:27 一条图图犬 阅读(93) 评论(0) 推荐(0) 编辑
摘要: ```C++ class Solution { public: bool IsPopOrder(vector pushV,vector popV) { if(pushV.empty() || popV.empty() || pushV.size() != popV.size()) return fa 阅读全文
posted @ 2018-09-02 19:59 一条图图犬 阅读(254) 评论(0) 推荐(0) 编辑
摘要: ```C++ class Solution { public: int MoreThanHalfNum_Solution(vector numbers) { if(numbers.empty()){ return 0; } if(numbers.size() == 1){ return numb... 阅读全文
posted @ 2018-08-30 15:05 一条图图犬 阅读(118) 评论(0) 推荐(0) 编辑
摘要: ```C++ class Solution { public: bool IsContinuous( vector numbers ) { if(numbers.empty()) return false; set s; for(int num: numbers){ if(num != 0){ if 阅读全文
posted @ 2018-08-30 14:29 一条图图犬 阅读(101) 评论(0) 推荐(0) 编辑
摘要: bfs dfs 阅读全文
posted @ 2018-08-30 11:30 一条图图犬 阅读(85) 评论(0) 推荐(0) 编辑
摘要: ```C++ void swap(char& a, char& b){ char temp = a; a = b; b = temp; } void pai(string& str, int start, int end, vector& res){ if(start == end){ string st = str; res.e... 阅读全文
posted @ 2018-08-29 18:24 一条图图犬 阅读(479) 评论(0) 推荐(0) 编辑
摘要: ```C++ void swap(char& a, char& b){ char temp = a; a = b; b = temp; } void perm(vector& vec, int start, int end, vector>& res){ if(start == end){ vector re(end, 0); fo... 阅读全文
posted @ 2018-08-29 16:46 一条图图犬 阅读(1689) 评论(0) 推荐(0) 编辑
摘要: ```C++ /* struct TreeNode { int val; struct TreeNode *left; struct TreeNode *right; TreeNode(int x) : val(x), left(NULL), right(NULL) { } };*/ class Solution { public: vector PrintFromTop... 阅读全文
posted @ 2018-08-26 17:34 一条图图犬 阅读(181) 评论(0) 推荐(0) 编辑
摘要: ```C++ class Solution { private: vector vec; public: void push(int value) { vec.emplace_back(value); } void pop() { if(vec.empty()) return; vec.erase(vec.end()-... 阅读全文
posted @ 2018-08-26 16:46 一条图图犬 阅读(78) 评论(0) 推荐(0) 编辑
摘要: ```C++ struct TreeNode { int val; TreeNode* left; TreeNode* right; explicit TreeNode(int x) : val(x), left(nullptr), right(nullptr) {} }; void trimLeftTrailingSpaces(string &input) ... 阅读全文
posted @ 2018-08-26 15:47 一条图图犬 阅读(880) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 ··· 21 下一页