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

Method Contains

structure/hashmap/hashmap.go:75–77  ·  view source on GitHub ↗

Contains checks if the given key is stored in the hashmap

(key any)

Source from the content-addressed store, hash-verified

73
74// Contains checks if the given key is stored in the hashmap
75func (hm *HashMap) Contains(key any) bool {
76 return hm.getNodeByKey(key) != nil
77}
78
79// getNodeByKey finds the node associated with the given key
80func (hm *HashMap) getNodeByKey(key any) *node {

Callers 3

TestNewFunction · 0.80
FuzzPolybiusFunction · 0.80
TestHashMapFunction · 0.80

Calls 1

getNodeByKeyMethod · 0.95

Tested by 3

TestNewFunction · 0.64
FuzzPolybiusFunction · 0.64
TestHashMapFunction · 0.64