
leetcode
pbegonia
这个作者很懒,什么都没留下…
展开
-
Single Number
利用异或运算,把相同的二进制位数都抵消掉,剩下了单独的那个数class Solution {public: int singleNumber(int A[], int n) { // Note: The Solution object is instantiated only once and is reused by each test case.原创 2014-03-08 10:08:12 · 347 阅读 · 0 评论 -
任意长度的两大数相乘
来源: 点击打开链接两大数相乘方法有三种: mo转载 2014-05-05 03:18:41 · 418 阅读 · 0 评论 -
ksum 问题
点击打开链接包含2sum 3sum 4sum 和k原创 2014-09-19 09:09:22 · 410 阅读 · 0 评论 -
Catalan 数
问题描述:卡塔兰数,是组合数学中一个常出现在各种计数问题中出现的数列。输入一个整数n,计算h(n)。其递归式如下:h(n)= h(0)*h(n-1)+h(1)*h(n-2) + ... + h(n-1)h(0) (其中n>=2,h(0) = h(1) = 1) 该递推关系的解为:h(n)=C(2n,n)/(n+1) (n=1,2,3,...)http://www.cnblogs.co转载 2014-03-13 06:30:29 · 414 阅读 · 0 评论