Documentation ¶
Index ¶
Constants ¶
View Source
const (
// DefaultSize is the default capacity of the table (16)
DefaultSize = 16
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HashTable ¶
type HashTable interface { // Set inserts a new key-value pair item into the hash table Set(k string, v interface{}) // Get returns the value of the given key // and a boolean which returns false if the // lookup result is nil otherwise true Get(k string) (interface{}, bool) // Remove deletes an item by the given key // and returns the deleted count Remove(k string) int // Iter returns an iterator for the hashtable Iter() <-chan *Entry // Exist returns true if an item with the given key exists in the table // otherwise returns false Exist(k string) bool // Len represents the size of the hash table Len() int }
HashTable data structure
func NewWithSize ¶
NewWithSize creates a new hashtable with the given size
Click to show internal directories.
Click to hide internal directories.