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
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
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
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
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
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
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