项目作者: michaelmherrera

项目描述 :
An implementation of an hashmap in go
高级语言: Go
项目地址: git://github.com/michaelmherrera/hashmap.git
创建时间: 2020-11-09T05:49:38Z
项目社区:https://github.com/michaelmherrera/hashmap

开源协议:

下载


Go Hashmap

An implementation of an <int, string> hashmap in go.

Functions

  1. // New Hashmap with default size of 8 and load factor of 2
  2. func New() Hashmap {}
  3. // NewWithSize Hashmap creates a hashmap of the specified initial size and a load factor of 2
  4. func NewWithSize(size uint64) Hashmap {}
  5. // Put a key-value pair into the hashmap
  6. func (m *Hashmap) Put(key int, val string) {}
  7. // Get a value given a key, if the value for that key exists
  8. func (m *Hashmap) Get(key int) (val string, found bool) {}
  9. // Remove the key-value pair associated with key. Return an error if the key doesn't exist
  10. func (m *Hashmap) Remove(key int) (err error) {}
  11. // ToString returns a string representation of the Hashmap, formatted similar to a Python dictionary
  12. func (m *Hashmap) ToString() string {}