适用于 .NET 的 Microsoft 集合

Microsoft Collections for .NET

.NET 带有一些内置集合(堆栈、队列、字典、列表等),但缺少其他常见集合,如优先级队列。 NuGet 上有很多第三方集合库,但我想知道是否有一个官方的 Microsoft 库(比如现在称为 System.Collections.Immutable 的 BCL 不可变集合)库,其中包含(可变)优先级队列之类的东西?

编辑:重要说明(@rmunn 的评论):

This question is not asking to recommend a library for X, it is asking a factual question, "Are there any official Microsoft libraries for X?"

我不确定您是否已经看过它,但是 System.Collections.Specialized 命名空间包含很多隐藏的宝石。 System.Linq 命名空间也值得一看。

.NET 6+: .NET 6 添加了一个 System.Collections.Generic.PriorityQueue<TElement,TPriority> class. And FWIW it is open-source and implemented in c#.

早期的 .NET Core 版本和 .NET Framework: Microsoft 已在 .NET Framework 中编写(并在线共享)2 internal PriorityQueue classes。你可以使用他们的代码。

另请参阅:Priority queue in .Net