我只是在互联网上搜索各种 .NET 集合的优缺点。我发现了以下几点
- 在查找值的上下文中,字典比列表更快。
- 在查找值的上下文中,HashSet 比 List 更快。
- 在查找值的上下文中,字典比哈希表更快。它们都不保证保留项目的顺序。
- 我读到 Hashset 是 .NET 中的快速集合
所以我得出以下 .NET 集合的排序顺序
- 哈希集
- 字典
- 哈希表
- 列表
- 数组列表
对于上面的排序顺序,我使用了以下链接
- What .NET collection provides the fastest search
- http://cidamon.com/blog/solution/27/dictionary-hashtable-and-hashset
- http://www.dotnetperls.com/dictionary-time
- c# When should I use List and when should I use arraylist?
- http://www.dotnetperls.com/hashtable
- .NET HashTable Vs Dictionary - Can the Dictionary be as fast?
- http://www.codeproject.com/Answers/197792/Hashtable-and-List-in-Csharp.aspx#answer1
除了上述问题,我还找到了一些有用的链接,我想分享一下
- What is the Generic version of a Hashtable?
- Why is Dictionary preferred over hashtable?
- Silverlight and ArrayList
上面的排序顺序是否正确?如果不能,请重新排列好吗?如果有人可以将更多的集合添加到上面列表的排序顺序中,那么将不胜感激。
最佳答案
关于c# - 能不能提供。 NET Collection 根据查找时间排序的顺序列表?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7119334/