- Type of data structure that stores key-value pairs
- Retrieve a certain value by using the key for that value
- A hash Table transforms a key into an integerr index using a hash function, and the index will decide where to store key/value pairr memory
: fast search, insertion, and delete operations
- Create a HashTable class with table and size initial properties
- Add a hash() function to transform keys into indices
- Add the set() and get() methods for adding and retrieving key/value pairs from the table.
Sometimes, the hash function in a Hash Table may return the same index number. In the test case above, the string "Spain" and "ǻ" both return the same hash value because the number 507 is the sum of both of their ASCII code.
The same hash value will cause the index to collide, overwriting the previous entry with the new one.
To handle the index number collision, you need to store the key/value pair in a second array so that the end result looks as follows:
: We need to upadate set, get, remove function
If you're moving to or from a rural area, you may need to pay more for transport, as there may be fewer carriers servicing those areas. Additionally, if you need door-to-door service, you may need to pay extra for the convenience.
https://www.youtube.com/watch?v=kRNUVD760WM
Wow!! Good summary for hash!! :)