2016年4月17日

数组中只出现一次的数字

摘要: class Solution { public: int last1(int res) { int len=1; while(res!=0&&res>>1&1!=1) { len++; res=res>>1; } return l... 阅读全文

posted @ 2016-04-17 13:53 RenewDo 阅读(126) 评论(0) 推荐(0) 编辑

平衡二叉树

摘要: class Solution { public: int depth(TreeNode* pRoot) { if(pRoot==NULL) return 0; if(pRoot->left==NULL&&pRoot->right==NULL) return 1; els... 阅读全文

posted @ 2016-04-17 13:34 RenewDo 阅读(110) 评论(0) 推荐(0) 编辑

二叉树的深度

摘要: class Solution { public: int Tree(TreeNode* pRoot) { if(pRoot==NULL) return 0; if(pRoot->left==NULL&&pRoot->right==NULL) return 1; int dep=... 阅读全文

posted @ 2016-04-17 12:58 RenewDo 阅读(67) 评论(0) 推荐(0) 编辑

导航