摘要:
class Solution { public: void push(int value) { stack1.push(value); } void pop() { stack1.pop(); } int top() { return stack1.top(); } int min(... 阅读全文
摘要:
/* struct TreeNode { int val; struct TreeNode *left; struct TreeNode *right; TreeNode(int x) : val(x), left(NULL), right(NULL) { } };*/ class Solution { public: ve... 阅读全文
摘要:
/* struct TreeNode { int val; struct TreeNode *left; struct TreeNode *right; TreeNode(int x) : val(x), left(NULL), right(NULL) { } };*/ class Solution { public: ... 阅读全文
摘要:
class Solution { public: bool VerifySquenceOfBST(vector sequence) { vector right; vector left; int size = sequence.size(); int last = sequence[size - 1]; ... 阅读全文
摘要:
class Solution { public: bool IsPopOrder(vector pushV, vector popV) { stack stack1; int i = 0; int j = 0; stack1.push(pushV[0]); while ((!s... 阅读全文
摘要:
class Solution { public: double Power(double base, int exponent) { if (exponent > 0) { double sqr = 1; int i = 0; for (int i = 0; i < expon... 阅读全文
摘要:
class Solution { public: void reOrderArray(vector &array) //加个&表示引用 { int array_size = array.size(); //int xiabiao = (array_size - 1); vector brray; for (in... 阅读全文
摘要:
/* struct ListNode { int val; struct ListNode *next; ListNode(int x) : val(x), next(NULL) { } };*/ class Solution { public: ListNode* FindKthToTail(ListNode* pListHead... 阅读全文
摘要:
/* struct ListNode { int val; struct ListNode *next; ListNode(int x) : val(x), next(NULL) { } };*/ class Solution { public: ListNode* Merge(ListNode* pHead1, ListNode... 阅读全文
摘要:
/* struct ListNode { int val; struct ListNode *next; ListNode(int x) : val(x), next(NULL) { } };*/ class Solution { public: ListNode* ReverseList(ListNode* pHead) ... 阅读全文
摘要:
/* struct TreeNode { int val; struct TreeNode *left; struct TreeNode *right; TreeNode(int x) : val(x), left(NULL), right(NULL) { } };*/ class Solution { //空树不是任意... 阅读全文
摘要:
class Solution { public: int NumberOf1(int n) { int count = 0; unsigned int flag = 1; while (flag) { if (n & flag) count++; ... 阅读全文
摘要:
class Solution { public: void quanpailie(vector &shuchu, string &temp, int start, int end) { if (start == end) { shuchu.push_back(temp); } for (i... 阅读全文