Documentation ¶
Index ¶
Constants ¶
View Source
const NSlot = 10000019 // number of slots for hashing, should be a prime number
Variables ¶
This section is empty.
Functions ¶
func DivisionHash ¶
A good hash func satisfies each key is equally likely to hash to any of the slots This func take a string as a represent of a radix-128 integer, return remainder when the string is divided by number of slots
Types ¶
type MyHashSet ¶
type MyHashSet struct {
// contains filtered or unexported fields
}
func Constructor ¶
func Constructor() MyHashSet
type MyMap ¶
MyMap implements map data structure, key data type is string, (average time to insert , search , delete is O(1)) using division method as hash function and resolve collision by chaining
Click to show internal directories.
Click to hide internal directories.