2015年3月8日
摘要: class Solution {public: vector buf; string getPermutation(int n, int k) { string result; int index = 0; for(index =1; index = k) ... 阅读全文
posted @ 2015-03-08 19:19 xgcode 阅读(140) 评论(0) 推荐(0)
摘要: class Solution {public: bool isSameTree(TreeNode *p, TreeNode *q) { if(p == NULL && q == NULL) return true; if(p == NULL || q ==... 阅读全文
posted @ 2015-03-08 13:31 xgcode 阅读(103) 评论(0) 推荐(0)
摘要: 这道题本质上是求阶乘中5的个数。还有一个公式即:[n/k]代表1~n中能被k整除的个数。class Solution{public: int trailingZeroes(int n) { int num= 0; while(n>0) { n... 阅读全文
posted @ 2015-03-08 13:23 xgcode 阅读(115) 评论(0) 推荐(0)