我有一个int值集合,它填充一个HashSet< int>以下列方式 –
var hashSet = new HashSet<int>(myIEnumerable);
假设迭代IEnumerable是O(n),那么创建HashSet< int>以这样的方式?@H_301_5@
解决方法
文件实际上指出:
This constructor is an O(n) operation,where n is the number of
elements in the collection parameter.@H_301_5@
http://msdn.microsoft.com/en-us/library/bb301504.aspx@H_301_5@