【发布时间】:2026-01-30 14:50:01
【问题描述】:
我知道这是一个实现细节,但我很好奇:.NET 字典中使用的哈希桶的数量是否有限制?我假设它将是somewhere around 2 * numberOfElements,但有人确定(或者它是否记录在任何地方)?
【问题讨论】:
-
您是否尝试查看源代码?
-
看看
HashHelpers类 -
源码有这两行
int size = HashHelpers.GetPrime(capacity); buckets = new int[size];
标签: c# .net memory dictionary hashtable