c# - 从集合创建 HashSet<int> 的最坏情况复杂度

标签 c# .net complexity-theory

我收藏了 int我用来填充 HashSet<int> 的值按照以下方式-

var hashSet = new HashSet<int>(myIEnumerable);

假设迭代 IEnumerableO(n) ,创建 HashSet<int>最坏情况复杂度是多少?以这种方式?

最佳答案

文档实际上指出:

This constructor is an O(n) operation, where n is the number of elements in the collection parameter.

http://msdn.microsoft.com/en-us/library/bb301504.aspx

关于c# - 从集合创建 HashSet<int> 的最坏情况复杂度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14071591/

相关文章:

algorithm - 带有扭曲的二分匹配

java - 时间复杂度修正冒泡排序

complexity-theory - 使用归纳法证明 n = Big-O(1)

通过 ScriptManager.RegisterStartupScript 调用时 JavaScript 回调函数无法找到控件

c# - 构造 WaveIn 时出现 NAudio InvalidOperationException

c# - 在 Windows 8 上对 Facebook 执行 Get 请求

.net - 带有 ASP.NET Core 库的 Docker 容器

c# - 为什么我的目录搜索需要这么长时间?

c# - 您可以通过 TcpClient 发送大于 SendBufferSize 的文件吗?

c# - 无法读取 Entity Framework 中的系统 View