相关疑难解决方法(0)

HashSet <T>与Dictionary <K,V>搜索时间以查找项目是否存在

HashSet<T> t = new HashSet<T>();
// add 10 million items


Dictionary<K, V> t = new Dictionary<K, V>();
// add 10 million items.
Run Code Online (Sandbox Code Playgroud)

谁的.Contains方法会更快返回?

只是为了澄清,我的要求是我有1000万个对象(嗯,真的是字符串),我需要检查它们是否存在于数据结构中.我永远不会迭代.

.net performance dictionary hashset

101
推荐指数
4
解决办法
7万
查看次数

标签 统计

.net ×1

dictionary ×1

hashset ×1

performance ×1