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 bool isSameTree(TreeNode *p, TreeNode *q) {13 // S... Read More
posted @ 2013-05-11 21:45 立春了 Views(125) Comments(0) Diggs(0) Edit
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 int countsub(TreeNode *root) {13 int minsub=1;1... Read More
posted @ 2013-05-11 21:30 立春了 Views(177) Comments(0) Diggs(0) Edit
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 int countsub(TreeNode *root) {13 int minsub=1;14 ... Read More
posted @ 2013-05-11 21:27 立春了 Views(129) Comments(0) Diggs(0) Edit
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 int sum(int val,TreeNode *root){13 int rootval... Read More
posted @ 2013-05-11 20:55 立春了 Views(144) Comments(0) Diggs(0) Edit
class Solution {public: bool isPalindrome(string s) { // Start typing your C/C++ solution below // DO NOT write int main() function transform(s.begin(), s.end(), s.begin(), ::toupper); string ss; for ( int i = 0; i != s.length(); ++i) { if ( isalnum(s[i]) ) ss.push_... Read More
posted @ 2013-05-11 19:15 立春了 Views(173) Comments(0) Diggs(0) Edit
class Solution {public: bool isPalindrome(string s) { // Start typing your C/C++ solution below // DO NOT write int main() function string ss; ss.assign(s.rbegin(),s.rend()); if(s==ss) return true; else return false; }}; Read More
posted @ 2013-05-11 18:58 立春了 Views(189) Comments(0) Diggs(0) Edit
http://kymcuc.blog.163.com/blog/static/201942114201271911954193/13、进程2012-08-19 11:23:25|分类:shell脚本|字号订阅1、查看进程负载(uptime)该命令显示开机至今的时间、用户数、及平均负载当平均负载持续地超出可用cpu(cpu个数)的承载时,表示系统工作已超出它所能负荷了,此时响应可能会陷入停滞不前的状态2、进程列表(1)ps:显示进程状态,该命令与ls命令相似(2)top:会在列表顶端显示cpu耗用最多的进程(3)在shell中,进程ID可以用$$表示(4)shell在处理下一个命令之前会等待一进 Read More
posted @ 2013-05-11 11:49 立春了 Views(372) Comments(0) Diggs(0) Edit