Reputation: 3858
I am trying to code a custom hashtable which can allows multiple values.
We are doing it in following way:
Means structure like:
value1 -> value6
NULL
Null
value3 -> value7
Null
...
...(until Int-Max)
Now, as we will store nearly 500 millions of key value pairs, at-lest 1600 millions link lists are going to be wasted.
Now, as per suggestion fro my working place, I am trying to build hashtable with structure like:
1 -> value1 -> value6
0
0
1 -> value3 -> value7 // here 0/1 bit defines linked lists exits or not
0
...
...(until Int-Max)
Can anybody help me is this possible to build such kind of structure ?
Edit:
Upvotes: 4
Views: 387
Reputation: 2484
You can not create an array of generic type because array is reified type. Generics are implemented by erasure.
Upvotes: 1