What's the point of a hash table?

后端 未结 11 1505
耶瑟儿~
耶瑟儿~ 2020-12-28 17:01

I don\'t have experience with hash tables outside of arrays/dictionaries in dynamic languages, so I recently found out that internally they\'re implemented by making a hash

11条回答
  •  再見小時候
    2020-12-28 17:18

    Also consider speed. If your key is a string and your values are stored in an array, your hash can access any element in 'near' constant time. Compare that to searching for the string and its value.

提交回复
热议问题