Describe how you could use a single array to implement three stacks.思路1:fixed divisionpackage Question3_1;import java.util.EmptyStackException;public ...
分类:
其他好文 时间:
2014-08-09 22:59:29
阅读次数:
401
1.1 Implement an algorithm to determine if a string has all unique characters. Whatif you cannot use additional data structures? 1 #include 2 #includ....
分类:
其他好文 时间:
2014-08-09 18:17:58
阅读次数:
199
画一个心形有非常多公式能够使用,以下这个公式我觉得最完美了:float x = R * 16 * pow(sin(theta), 3);float y = R * (13 * cos(theta) - 5*cos(2*theta) - 2*cos(3*theta) - cos(4*theta));画...
分类:
其他好文 时间:
2014-08-08 17:43:06
阅读次数:
291
Problem Description:
Implement pow(x, n).
分析:题目意思很简单,要求计算x的n次幂,其中x给的是double类型,n需要考虑负数的情况,利用二分的思想每次将n减半,递归计算可以得到最终结果,其中一些细节需要注意,具体的实现代码如下:
class Solution {
public:
bool isequal(double a,doubl...
分类:
其他好文 时间:
2014-08-07 19:17:00
阅读次数:
179
题目:Implement strStr().Returns a pointer to the first occurrence of needle in haystack, or null if needle is not part of haystack.题解:其实我觉得这题。。为啥不给个更明确....
分类:
编程语言 时间:
2014-08-07 12:43:19
阅读次数:
227
题目: 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 be....
分类:
编程语言 时间:
2014-08-07 12:08:49
阅读次数:
260
策略模式定义了一系列的算法,并将每一个算法封装起来,而且使它们还可以相互替换。而对于客户端(UI)来说,可以通过IOC再配合工厂模块,实现动态策略的切换,策略模块通常于一个抽象策略对象(interface or abstract class),多个具体策略对象(implement class )和一...
分类:
其他好文 时间:
2014-08-07 09:43:19
阅读次数:
159
求2的32次方
普通程序员
Java code ?
1System.out.println(Math.pow(2, 32));
文艺程序员
Java code ?
1System.out.println(1L
2B程序员
Java code ?
1System.out.println(2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*2*...
分类:
其他好文 时间:
2014-08-06 19:26:42
阅读次数:
261
sqrt(pow((X1-X2),2)+pow((Y1-Y2),2)+pow((Z1-Z2),2))/10floatX=pow ($BB.pos.x- $AA.pos.x) 2floatY=pow ($BB.pos.y- $AA.pos.y) 2floatZ=pow ($BB.pos.z- $AA....
分类:
其他好文 时间:
2014-08-06 18:49:41
阅读次数:
171
题目:Implement regular expression matching with support for '.' and '*'.'.' Matches any single character.'*' Matches zero or more of the preceding elem....
分类:
编程语言 时间:
2014-08-06 04:11:20
阅读次数:
429