Documentation
¶
Index ¶
- type Hashtable
- func (h *Hashtable) Collisions() int
- func (h *Hashtable) Delete(key string) error
- func (h *Hashtable) Exists(key string) bool
- func (h *Hashtable) Get(key string) (int, error)
- func (h *Hashtable) GetSimilarSentences() [][]string
- func (h *Hashtable) Insert(key string, value int) error
- func (h *Hashtable) Keys() []string
- func (h *Hashtable) Print() string
- func (h *Hashtable) Update(key string, value int) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Hashtable ¶
type Hashtable struct {
// contains filtered or unexported fields
}
func New ¶
New will create a new hashtable with a capacity approximately the size given as an argument. The true size is the smallest power of 2 that is greater than the requested size
func (*Hashtable) Collisions ¶
func (*Hashtable) Delete ¶
Delete deletes a key/value pair from the hashtable. Should return an error if the given key doesn't exist.
func (*Hashtable) Get ¶
Get returns the value associated with the given key. Should return an error if value doesn't exist.
func (*Hashtable) GetSimilarSentences ¶
func (*Hashtable) Insert ¶
Insert inserts a new key/value pair into the hashtable. Should return an error if the key already exists.
Click to show internal directories.
Click to hide internal directories.