Hashed Knowledge - abukhalil-LTUC-ASAC/amman-401d4 GitHub Wiki
When you tried the solution before knowing the problem..
Funny enough, this implementation of hashing into a table was done after seeing a colleague doing something similar to store unique key:value pairs and implemented it during the history storage of api calls.. MD5 Hash was used to convert the whole url+method+params into a hash that is stored as a key in an object, and can be called again directly by implementing that key we want to apply its url+method+params again.
Hash is when you'd convert strings and values into a series of intelligible characters that represents the original exactly, so each input and output should be connected one to one, unless collision happens.
From the previous exercise, hash tables store the index with a known key, by implementing the key into the hashtable, we could get the index that would return the value in an array instead of finding it through the for loop.
There are no perfect hashes
Collision is when an index, can be found using more than one key, this is usually solved by implementing the key to return a linkedlist of keys and values that are called buckets instead of indices.
This solutions keeps the original speed, and fixes the problem of having an index that is fetched using more than a single key, so now each index of a bucket holds linked-lists of key-value pairs! If you think I totally understand it then you are wrong, I only have passable understanding so see you tomorrow!