https://oj.leetcode.com/problems/longest-common-prefix/http://fisherlei.blogspot.com/2012/12/leetcode-longest-common-prefix.htmlpublicclassSolution{
publicStringlongestCommonPrefix(String[]strs)
{
//Validations
if(strs==null||strs.length==0)
return"";
if(s..
分类:
其他好文 时间:
2015-01-02 16:13:25
阅读次数:
103
https://oj.leetcode.com/problems/letter-combinations-of-a-phone-number/http://fisherlei.blogspot.com/2012/12/leetcode-letter-combinations-of-phone.htmlpublicclassSolution{
publicList<String>letterCombinations(Stringdigits){
if(digits==null)
returnnul..
分类:
其他好文 时间:
2015-01-02 16:13:14
阅读次数:
134
https://oj.leetcode.com/problems/generate-parentheses/http://fisherlei.blogspot.com/2012/12/leetcode-generate-parentheses.htmlpublicclassSolution{
publicList<String>generateParenthesis(intn){
//SolutionB:
//returngenerateParenthesis_BruteForce(n);
..
分类:
其他好文 时间:
2015-01-02 16:12:32
阅读次数:
137
我们在编写程序时,经常遇到两个模块的功能非常相似,只是一个是处理int数据,另一个是处理string数据,或者其他自定义的数据类型,但我们没有办法,只能分别写多个方法处理每个数据类型,因为方法的参数类型不同。有没有一种办法,在方法中传入通用的数据类型,这样不就可以合并代码了吗?泛型的出现就是专门解决...
usingSystem.Text.RegularExpressions////// 去除HTML标记//////包括HTML的源码///已经去除后的文字publicstaticstring NoHTML(string Htmlstring){//删除脚本 Htmlstring= Regex.Repl...
分类:
Web程序 时间:
2015-01-02 15:55:11
阅读次数:
206
url: 要求为String类型的参数,(默认为当前页地址)发送请求的地址。type: 要求为String类型的参数,请求方式(post或get)默认为get。注意其他http请求方法,例如put和delete也可以使用,但仅部分浏览器支持。timeout: 要求为Number类型的参数,设置请求超...
分类:
Web程序 时间:
2015-01-02 15:50:49
阅读次数:
158
生产者消费者的问题 String 类适用于描述字符串事物。那么他就提供了多个方法对字符串进行操作。常见的操作有哪些?1,获取 1.1字符串的长度 int length(); 1.2获取某个位置上的字符 char chaeAt(int index) 1.3 根据字符获取该字符在字符串中的位置。int ...
分类:
其他好文 时间:
2015-01-02 15:50:03
阅读次数:
161
可空(null)数据类型:引用类型;自定义类,string,大部分的类都是 不可空数据类型:值类型;int?,boolean,decimal,datetime等 ----------------------------------------------------------------------------...
Fou循环常常用,但是在字节码层它是怎样执行的呢?出于兴趣驱使,就有了这篇短文了! 首先要分析字节码就得先写个类了,代码如下: public?class?ForTest{
public?static?void?main(String[]?args)?{
f...
分类:
编程语言 时间:
2015-01-02 14:45:18
阅读次数:
217