I know the theory: "Hash the value you want to store and use the hash-th place in the array to store it".
That gives me some problems though. I have a hash function that hashes any string to a number between 1 and 20,158,268,676. So for example:
Now if I follow the theory I would need an array of size at least 8407130567 to save my values. Then I would save with:Code:"Athens" -> 8407130567 "Sparta" -> 597153027
That ofcourse is not practical as it needs an enormous array. So how do we implement this? Is there some flaw in my thinking?Code:array="Athens" array="Sparta"