Describe a hash function and hashmap? Algorithmic Questions (LC Medium)
Utilisateur anonyme
A function that takes a key, applies a mathematical function, and outputs a value is a hash function. A hashmap is a dynamic list (typically but other structures exist), where a hash function exists that can turn keys to indices on the list. There may be collisions, which is why it's 'expected' O(1), not worst case. Etc... Algorithmic Knoweldge + LC Practice for the LC Problems.