Hash Tables Class Help
This class provides functions for a hash table data type.
A hash table associates keys with values and provides near constant time value lookup by use of a hash function.
The hash function takes in a key, and by chopping and mixing its bits, produces a hash value that LabWindows/CVI uses to directly address a bucket, or storage location, within the table. A good hash function should evenly distribute keys throughout the buckets of the table. However, even with a good hash function, different keys may end up hashing to the same bucket. This is known as a collision.
The LabWindows/CVI hash table uses chaining to resolve collisions. With chaining, each bucket in the table stores a linked list of key-value pairs. When a collision occurs, the new key-value pair is added to the front of that bucket's list. As more items are added to the table, the number of free buckets decreases and the number of collisions increases. Chaining ensures that even when the load on the table becomes high, the table's performance degrades linearly.
Library: Programmer's Toolbox Control