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