摘要: class Solution { public: void push(int value) { stack1.push(value); } void pop() { stack1.pop(); } int top() { return stack1.top(); } int min(... 阅读全文
posted @ 2017-08-06 22:57 双马尾是老公的方向盘 阅读(515) 评论(0) 推荐(0) 编辑
摘要: /* struct TreeNode { int val; struct TreeNode *left; struct TreeNode *right; TreeNode(int x) : val(x), left(NULL), right(NULL) { } };*/ class Solution { public: ve... 阅读全文
posted @ 2017-08-06 22:56 双马尾是老公的方向盘 阅读(163) 评论(0) 推荐(0) 编辑
摘要: /* struct TreeNode { int val; struct TreeNode *left; struct TreeNode *right; TreeNode(int x) : val(x), left(NULL), right(NULL) { } };*/ class Solution { public: ... 阅读全文
posted @ 2017-08-06 21:55 双马尾是老公的方向盘 阅读(143) 评论(0) 推荐(0) 编辑
摘要: class Solution { public: bool VerifySquenceOfBST(vector sequence) { vector right; vector left; int size = sequence.size(); int last = sequence[size - 1]; ... 阅读全文
posted @ 2017-08-06 18:41 双马尾是老公的方向盘 阅读(155) 评论(0) 推荐(0) 编辑
摘要: class Solution { public: bool IsPopOrder(vector pushV, vector popV) { stack stack1; int i = 0; int j = 0; stack1.push(pushV[0]); while ((!s... 阅读全文
posted @ 2017-08-06 18:07 双马尾是老公的方向盘 阅读(169) 评论(0) 推荐(0) 编辑
摘要: class Solution { public: double Power(double base, int exponent) { if (exponent > 0) { double sqr = 1; int i = 0; for (int i = 0; i < expon... 阅读全文
posted @ 2017-08-06 17:06 双马尾是老公的方向盘 阅读(152) 评论(0) 推荐(0) 编辑
摘要: class Solution { public: void reOrderArray(vector &array) //加个&表示引用 { int array_size = array.size(); //int xiabiao = (array_size - 1); vector brray; for (in... 阅读全文
posted @ 2017-08-06 17:03 双马尾是老公的方向盘 阅读(150) 评论(0) 推荐(0) 编辑
摘要: /* struct ListNode { int val; struct ListNode *next; ListNode(int x) : val(x), next(NULL) { } };*/ class Solution { public: ListNode* FindKthToTail(ListNode* pListHead... 阅读全文
posted @ 2017-08-06 17:00 双马尾是老公的方向盘 阅读(110) 评论(0) 推荐(0) 编辑
摘要: /* struct ListNode { int val; struct ListNode *next; ListNode(int x) : val(x), next(NULL) { } };*/ class Solution { public: ListNode* Merge(ListNode* pHead1, ListNode... 阅读全文
posted @ 2017-08-06 16:58 双马尾是老公的方向盘 阅读(134) 评论(0) 推荐(0) 编辑
摘要: /* struct ListNode { int val; struct ListNode *next; ListNode(int x) : val(x), next(NULL) { } };*/ class Solution { public: ListNode* ReverseList(ListNode* pHead) ... 阅读全文
posted @ 2017-08-06 16:36 双马尾是老公的方向盘 阅读(227) 评论(0) 推荐(0) 编辑
摘要: /* struct TreeNode { int val; struct TreeNode *left; struct TreeNode *right; TreeNode(int x) : val(x), left(NULL), right(NULL) { } };*/ class Solution { //空树不是任意... 阅读全文
posted @ 2017-08-06 11:50 双马尾是老公的方向盘 阅读(249) 评论(0) 推荐(0) 编辑
摘要: class Solution { public: int NumberOf1(int n) { int count = 0; unsigned int flag = 1; while (flag) { if (n & flag) count++; ... 阅读全文
posted @ 2017-08-06 11:10 双马尾是老公的方向盘 阅读(110) 评论(0) 推荐(0) 编辑
摘要: class Solution { public: void quanpailie(vector &shuchu, string &temp, int start, int end) { if (start == end) { shuchu.push_back(temp); } for (i... 阅读全文
posted @ 2017-08-06 11:04 双马尾是老公的方向盘 阅读(131) 评论(0) 推荐(0) 编辑