Question regarding performance of HashTable of LinkedList Nodes

I implemented a HashTable with variable size buckets on init of the Class, merely an Array of linked lists sized at Runtime.

The issue is that with a small number of buckets where the linked-list must be traversed (can reach approx. 5K nodes in depth) is outperforming a HashTable with more buckets differing on three orders of magnitude greater.


int BIG_BUCKET_SIZE = 10000;

HashTable smallHashTable = new HashTable<>(SMALL_BUCKET_SIZE);

HashTable bigHashtTable = new HashTable<>(BIG_BUCKET_SIZE);

I would expect the larger HashTable to be O(1) for search where the smaller hashtable having a...

Read More »

By: StackOverFlow - Thursday, 8 November

Related Posts