Created
May 14, 2017 22:06
-
-
Save chriswebb09/fd034148e2ae834c1c4c8df4052b26d5 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
struct HashTable<Key: Hashable, Value> { | |
typealias Bucket = [HashElement<Key, Value>] | |
var buckets: [Bucket] | |
init(capacity: Int) { | |
assert(capacity > 0) | |
buckets = Array<Bucket>(repeatElement([], count: capacity)) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment