OpenaddressHashtable

 1 public class OpenaddressHashtable {
 2     
 3     private int[] hashtable;
 4     private int hashsize;
 5     
 6     public OpenaddressHashtable(int size){
 7         hashsize=size;
 8         hashtable=new int[hashsize];
 9     }
10     
11     public int hashFunc(int key){
12         return key%hashsize;
13     }
14     public int hashFunc2(int key){
15         return 5-key%5;
16     }
17 
18 }

 

posted on 2013-04-01 16:06  melotang  阅读(133)  评论(0)    收藏  举报