MCPcopy Create free account
hub / github.com/ua-nick/Data-Structures-and-Algorithms / Get

Method Get

HashTable/HashTable.go:28–38  ·  view source on GitHub ↗
(key string)

Source from the content-addressed store, hash-verified

26}
27
28func (table *HashTable) Get(key string) (int, bool) {
29 position := generateHash(key)
30 current := table.data[position]
31 for current != nil {
32 if current.key == key {
33 return current.data, true
34 }
35 current = current.next
36 }
37 return 0, false
38}
39
40func (table *HashTable) Set(key string, value int) bool {
41 position := generateHash(key)

Callers

nothing calls this directly

Calls 1

generateHashFunction · 0.85

Tested by

no test coverage detected