A Hash Table can map key to value for highly efficient lookup.
A Hash Table uses a hash function to compute an index into an array of buckets or slots, from which the correct value can be found.
[1]
[1] Image from Wikipedia, A small phone book as a hash table.
The goal of Hash Table is,
- Keys are uniformly distributed in it, regardless of the sequence.
- It supports insert, remove and find operations.
- Each operation has better time complexity than O(log n).
Then in the next post, the method of Hashing will be introduced to use on the Hash Table.
No comments:
Post a Comment