2013年5月11日
摘要: 1 /** 2 * Definition for binary tree 3 * struct TreeNode { 4 * int val; 5 * TreeNode *left; 6 * TreeNode *right; 7 * TreeNode(int x) : val(x), left(NULL), right(NULL) {} 8 * }; 9 */10 class Solution {11 public:12 vector<vector<int> > levelOrderBottom(TreeNode *root) {13 ... 阅读全文
posted @ 2013-05-11 18:57 宇睿 阅读(104) 评论(0) 推荐(0) 编辑
摘要: 1 /** 2 * Definition for binary tree 3 * struct TreeNode { 4 * int val; 5 * TreeNode *left; 6 * TreeNode *right; 7 * TreeNode(int x) : val(x), left(NULL), right(NULL) {} 8 * }; 9 */10 class Solution {11 public:12 TreeNode *sortedArrayToBST(vector<int> &num) {13 /... 阅读全文
posted @ 2013-05-11 18:31 宇睿 阅读(131) 评论(0) 推荐(0) 编辑
摘要: 1 /** 2 * Definition for binary tree 3 * struct TreeNode { 4 * int val; 5 * TreeNode *left; 6 * TreeNode *right; 7 * TreeNode(int x) : val(x), left(NULL), right(NULL) {} 8 * }; 9 */10 class Solution {11 public:12 13 int min=10000;14 void meng(TreeNode*root,int dep)15... 阅读全文
posted @ 2013-05-11 18:15 宇睿 阅读(124) 评论(0) 推荐(0) 编辑
摘要: //这段代码首先判断算法是否正确 :) 1 class Solution { 2 public: 3 bool isP(string s) 4 { 5 string ss; 6 ss.assign(s.rbegin(),s.rend()); 7 if(s==ss) 8 return true; 9 else10 return false;11 }12 int minCut(string s) {13 // Start typin... 阅读全文
posted @ 2013-05-11 14:41 宇睿 阅读(185) 评论(0) 推荐(0) 编辑
  2013年5月8日
摘要: 1 #include <stdio.h> 2 3 4 5 6 struct MyPoint 7 { 8 int x; 9 int y; 10 }; 11 12 struct MyPoint p[(1<<13)+1]; 13 14 void fold(int n) 15 { 16 int i,c; 17 if (n==0) 18 { 19 p[0].x=0; 20 p[0].y=0; 21 p[1].x=1; 22 p[1].y=0; 23 re... 阅读全文
posted @ 2013-05-08 12:42 宇睿 阅读(328) 评论(1) 推荐(0) 编辑
  2013年5月7日
摘要: REG EXPORT HKEY_CURRENT_USER\Software\SimonTatham SESSION.REG 阅读全文
posted @ 2013-05-07 20:47 宇睿 阅读(230) 评论(0) 推荐(0) 编辑
  2013年5月5日
摘要: http://www.roguewave.com/portals/0/products/threadspotter/docs/2010.4/manual/index.html介绍了内存的一些知识 阅读全文
posted @ 2013-05-05 09:29 宇睿 阅读(158) 评论(1) 推荐(0) 编辑
  2013年5月3日
摘要: 1 class Solution { 2 public: 3 bool isPalindrome(string s) { 4 // Start typing your C/C++ solution below 5 // DO NOT write int main() function 6 if(s.size()==0) 7 return true; 8 vector<char> v1; 9 int i;10 for(i=0;i<s.size();i++)11 ... 阅读全文
posted @ 2013-05-03 20:39 宇睿 阅读(138) 评论(0) 推荐(0) 编辑
  2013年5月1日
摘要: 1 #include<string> 2 #include<vector> 3 #include<sstream> 4 #include <iostream> 5 #include <algorithm> 6 using namespace std; 7 8 9 10 int main()11 {12 string s="724 42 13 17 1199 577 1001 1101 483 845 196 1163 360 985 296 1044 917 1007 898 119 1016 23 56 1159 1194 阅读全文
posted @ 2013-05-01 23:51 宇睿 阅读(235) 评论(0) 推荐(0) 编辑
  2013年4月30日
摘要: 1 class Solution { 2 public: 3 int lengthOfLastWord(const char *s) { 4 // Start typing your C/C++ solution below 5 // DO NOT write int main() function 6 const char *p,*q; 7 p=s; 8 q=p+strlen(p)-1; 9 10 while(p<q)11 {12 ... 阅读全文
posted @ 2013-04-30 22:45 宇睿 阅读(144) 评论(0) 推荐(0) 编辑