Created
September 22, 2008 19:54
-
-
Save bmaland/12129 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def hashing_necessary? numwords, hashkeys | |
numkeys = hashkeys.flatten.uniq.size | |
(numkeys < numwords) ? "rehash necessary" : "successful hashing" | |
end | |
puts hashing_necessary? 3, [[0, 1], [1, 2], [2, 0]] | |
puts hashing_necessary? 6, [[2, 3], [3, 1], [1, 2], [5, 1], [2, 5]] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment