简体   繁体   English

c# 中的哈希表数据结构(按密钥哈希排序)的目的是什么?

[英]What is the purpose of hashtable datastructure (sorted by key hash) in c#?

I know that hastable datastructure will store key value pair.我知道 hastable 数据结构将存储键值对。 And that key is sorted based on the hash value.并且该键是根据 hash 值排序的。

Whereas the sorted list is the same but sorted on the actual key value rather than the hash.而排序列表是相同的,但按实际键值而不是 hash 排序。

What is the purpose of hash table- or in other words what is the benefit of sorting key by hash value? hash 表的目的是什么 - 或者换句话说,按 hash 值排序键有什么好处?

Adding to Mark's comment on the question, it is about the speed of the lookup.添加到马克对这个问题的评论中,它是关于查找速度的。

See this answer: https://stackoverflow.com/a/25194575/1691226看到这个答案: https://stackoverflow.com/a/25194575/1691226

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM