Different way of implementing my reHash() algorithm

I'm implementing a hash table without the use of any built-in java HashTable features, and getting a compile-time error with the line:

newHashTable.add(reHashValueIndex, bucket.get(j));//insert values into new table

ERROR: no suitable method found for add(int, String)

I get that a String is not the same type as an ArrayList of LinkedLists of type String, which is why I'm getting the error, but I could use some assistance as to another way to possibly implement reHash()

public void reHash(ArrayList> oldHashTable)


ArrayList> newHashTable = new ArrayList(oldHashTable.size()*2);

//rehash values in oldHashTable

for (int i = 0; i < (oldHashTable.size()); i++)//loop...

Read More »

By: StackOverFlow - Wednesday, 7 November

Related Posts