码迷,mamicode.com
首页 >  
搜索关键字:implement pow    ( 4537个结果
[leetcode] Implement strStr()
Implement strStr().
分类:其他好文   时间:2014-06-27 12:37:14    阅读次数:198
[leetcode] [leetcode] String to Integer (atoi)
Implement atoi to convert a string to an integer.
分类:其他好文   时间:2014-06-27 12:08:39    阅读次数:143
[leetcode] Pow(x, n)
Implement pow(x, n).
分类:其他好文   时间:2014-06-27 12:01:51    阅读次数:171
LeetCode: Single Number [136]
【题目】 Given an array of integers, every element appears twice except for one. Find that single one. Note: Your algorithm should have a linear runtime complexity. Could you implement it without using extra memory? 【题意】 给定一个整数数组,其中除了一个数以外,其他数都是成对出现的,...
分类:其他好文   时间:2014-06-26 10:13:27    阅读次数:254
[LeetCode]LRU Cache有个问题,求大神解答
题目:Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations:getandset.get(key)- Get the v...
分类:其他好文   时间:2014-06-25 14:12:42    阅读次数:214
uva 10843 - Anne's game(数论cayley定理)
题目链接:uva 10843 - Anne's game 题目大意:给出n,问说有n个节点构成的标号树有多少种。 解题思路:cayley定理的躶题。 #include #include typedef long long ll; const ll MOD = 2000000011; ll Pow (ll x, ll n) { if (n 0) ret...
分类:其他好文   时间:2014-06-24 23:46:31    阅读次数:239
String to Integer (atoi)
题目 Implement atoi to convert a string to an integer. Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below and ask yourself what are the possibl...
分类:其他好文   时间:2014-06-24 23:14:28    阅读次数:238
【LeetCode】Pow(x, n)
题目 Implement pow(x, n). 解答 直接用递归法: //递归法("折半"递归,不要用常规的一个个乘,效率很低) public class Solution { public double pow(double x, int n) { if(n==0) return 1; if(n==1) ...
分类:其他好文   时间:2014-06-24 21:14:37    阅读次数:199
LeetCode || LRU Cache
Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and set. get(key) - Get the value (will always be positive) of the key if ...
分类:其他好文   时间:2014-06-24 17:25:41    阅读次数:197
LeetCode——Single Number II
Given an array of integers, every element appears three times except for one. Find that single one. Note: Your algorithm should have a linear runtime complexity. Could you implement it without u...
分类:其他好文   时间:2014-06-24 15:52:58    阅读次数:222
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!