CC150 chapter 1 总结
1
HashTable: 实质是Array. 如何实现HashTable 在Java中
Here is the way that implments the hash table. A hashtable is a array of listnode. and the time complexity for all the basic operation including search, add and remove is O(1).
Here is how to implement the hashtable
http://math.hws.edu/javanotes/c10/ex3-ans.html.
when the number of the hashtable elements exceeds the 0.75* the length of the hashtable. then we need to rehash it.
ArrayList 是一个长度可变的数组
http://www.tutorialspoint.com/java/java_arraylist_class.htm
StringBuffer 实现了一个String数组,是一个String , 通常当对String多次操作时,选用StringBuffer 可以节省程序空间
1 题目 implement a determine a if all the chars in a string are unique, use the array for 32 bits. boolean judge = new judge[32];
2 decide if a string is a permutation of the other. use the int[]数组统计。注意首先进行长度的判断
3 rotate a image.
4judge if the string is a rotated version of the other s1s1 ,s2 judge is substring.
method how to judge if this is substring.?