When to use a HashTable

后端 未结 8 908
眼角桃花
眼角桃花 2020-12-24 02:13

In C#, I find myself using a List, IList or IEnumerable 99% of the time. Is there a case when it would be b

8条回答
  •  执念已碎
    2020-12-24 03:01

    Hash-tables are good choices if you are often doing "for something in collection" and you aren't concerned about the order of items in the collection.

    Hash-tables are indexes. You can maintain a hash-table to index a list, so you can both choice to access it in order or randomly based upon the key.

提交回复
热议问题