开发者

How to use hashtable? [duplicate]

This question already has answers here: 开发者_开发技巧 Closed 11 years ago.

Possible Duplicate:

When to use a HashTable

Why we use Hashtable in csharp? What is the need of it?


Probably you don't want to use the HashTable (non generic) at all, but rather use the

Dictionary<TKey, TValue>

or the

HashSet<T>

if you only need keys


When to use a HashTable


One easy answer would be "performance" using hashtables to store data makes it possible to find and access the data much faster than iteraing over all objects in a list. Wikipedia has a great (large) article about hash tables in general, which gives a good description about it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜