HashSet<T> vs List<T>
摘要:
大数据量下,生成HashSet成本要稍高于List。但查询HashSet效率要远高于List。 static void Main(string[] args) { Stopwatch watch = new Stopwatch(); List<string> list = new List<string>(); HashSet<string> hash = new HashSet<string>(); watch.Start(); for (int i = 0; i <... 阅读全文