MCPcopy Index your code
hub / github.com/TheAlgorithms/Go / New

Function New

structure/hashmap/hashmap.go:32–38  ·  view source on GitHub ↗

New creates a new HashMap instance with the specified size and capacity

(size, capacity uint64)

Source from the content-addressed store, hash-verified

30
31// New creates a new HashMap instance with the specified size and capacity
32func New(size, capacity uint64) *HashMap {
33 return &HashMap{
34 size: size,
35 capacity: capacity,
36 table: make([]*node, capacity),
37 }
38}
39
40// Get returns the value associated with the given key
41func (hm *HashMap) Get(key any) any {

Callers 1

TestHashMapFunction · 0.92

Calls

no outgoing calls

Tested by 1

TestHashMapFunction · 0.74