Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters fo...
分类:
其他好文 时间:
2015-03-21 21:12:41
阅读次数:
150
DescriptionCycle shifting refers to following operation on the sting. Moving first letter to the end and keeping rest part of the string. For example,...
分类:
其他好文 时间:
2015-03-21 21:08:29
阅读次数:
713
【题目】
Given s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2.
For example,
Given:
s1 = "aabcc",
s2 = "dbbca",
When s3 = "aadbbcbcac", return true.
When s3 = "aadbbb...
分类:
其他好文 时间:
2015-03-21 20:03:14
阅读次数:
124
题目:
Write a function to find the longest common prefix string amongst an array of strings.
即求给定的一组字符串的公共前缀。思路分析:
一个一个寻找前缀,先比较第一个和第二个,找到公共前缀,然后公共前缀和第三个比较,寻找公共前缀,以此类推。C++参考代码:class Solution
{
public:...
分类:
其他好文 时间:
2015-03-21 20:01:49
阅读次数:
173
对于实现Serializable的子类,该子类中的属性类型必须全部都是已经实现Serializable的子类。
如:
public class User implements Serializable {
String name;
// public PackageManager pm; //PackageManager 因为没有实现Serializable接口,所以运行时会抛异常...
分类:
其他好文 时间:
2015-03-21 20:00:31
阅读次数:
102
1.在计算机中,浮点数并不同等于小数。public static void main(String[] args) { double b1 = 0.1; double b2 = 0.2; double result = b1 + b2; S...
分类:
编程语言 时间:
2015-03-21 19:49:49
阅读次数:
163
一 , 集合的体会(Collection , list, set ,map) 1,遍历list的方法: 第一种方法:for-each方法 public class ListTest{ public static void main(String[] args){ List lis...
分类:
编程语言 时间:
2015-03-21 19:49:39
阅读次数:
130
获取手机wifi信息 /**
* 获取Wifi的Mac地址
* @param context
* @return
*/
public static String getWifiBssid(Context context) {
WifiManager wifi = (WifiManager) context.getSystemServ...
分类:
其他好文 时间:
2015-03-21 18:44:37
阅读次数:
191
1、对于string,number等基础类型,==和===是有区别的
1)不同类型间比较,==之比较“转化成同一类型后的值”看“值”是否相等,===如果类型不同,其结果就是不等
2)同类型比较,直接进行“值”比较,两者结果一样
2、对于Array,Object等高级类型,==和===是没有区别的
进行“指针地址”比较
3、基础类型与高级类型,==和===是有区别的
1)...
分类:
Web程序 时间:
2015-03-21 18:42:43
阅读次数:
131
Java实现多线程的两种方式分别是继承Thread类和实现Runnable接口。
代码示例:
class MyThread extends Thread{
private String name;
public MyThread(String name){
this.name = name;
}
@Override
public void run(){
for...
分类:
编程语言 时间:
2015-03-21 18:41:54
阅读次数:
265