Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HashTable ¶
type HashTable[K comparable, V any] struct { // contains filtered or unexported fields }
HashTable stores key/value pairs where the number of hashtable buckets is n number of buckets.
A smaller number of buckets means less buckets will be created, but each key stored in the HashTable has a higher likelihood of having to share a bucket with other keys, thus slowing down lookups.
A larger number of buckets means more buckets will be created, so each key stored in the Table has a lower likelihood of having to share a bucket with other keys, thus speeding up lookups.
func New ¶
func New[K comparable, V any](numberOfBuckets int, hash hash[K]) *HashTable[K, V]
New creates a table with n number of internal buckets which uses the specified hash function for an input type K.
Click to show internal directories.
Click to hide internal directories.