What does “bucket entries” mean in the context of a hashtable?

前端 未结 4 1223
感情败类
感情败类 2021-02-01 04:17

What does \"bucket entries\" mean in the context of a hashtable?

4条回答
  •  遇见更好的自我
    2021-02-01 04:34

    From Wikipedia:

    hash table or hash map is a data structure that uses a hash function to map identifying values, known as keys (e.g., a person's name), to their associated values (e.g., their telephone number). Thus, a hash table implements an associative array. The hash function is used to transform the key into the index (the hash) of an array element (the slot or bucket) where the corresponding value is to be sought.

    enter image description here

    Each entry in the array/vector is called as an Bucket.

提交回复
热议问题