1 | Closed bucket
|
---|
2 |
|
---|
3 | private int hash(K key) {
|
---|
4 | return Math.abs(key.hashCode()) % buckets.length ;
|
---|
5 | }
|
---|
6 |
|
---|
7 |
|
---|
8 | Open Bucket
|
---|
9 |
|
---|
10 | private int hash(K key) {
|
---|
11 | int h = 0;
|
---|
12 | for (int i = 0; i<izbor.lenght() ; i++
|
---|
13 | {
|
---|
14 | h += zbor.ChatAt(i)*Math.pow(31,i) ;
|
---|
15 | }
|
---|
16 | return h ;
|
---|
17 | } |
---|