CC150 chapter 1 Arrays and strings.

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.?


發佈了123 篇原創文章 · 獲贊 0 · 訪問量 3萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章