C#替代了C ++ STL集合< T> [英] C# alternative for the C++ STL set<T>
问题描述
我在寻找一个排序的数据结构,这将是类似于STL集合(T)。
我发现排序列表,但它需要(键,VAL),我正在寻找类似列表(字符串) - 只有分类
I'm looking for a sorted data structure, that will be similar to the STL set(T). I found SortedList, but it requires (key, val), I'm looking for something like List(string) - only sorted.
我发现网络Spring.Collections,但我的框架不承认它。
I found on the web Spring.Collections, but my framework does not recognize it.
有一个简单的SortedSet,我可以在常规基础架构使用?
Is there a simple SortedSet I could use in the regular basic framework?
谢谢,
加尔
推荐答案
您可以用System.Collections中做到这一点。 Generic.Dictionary。这里有一个很好的文章: Dictionarys和排序
You can do this with A System.Collections.Generic.Dictionary. Here's a good article: Dictionarys and sorting
编辑:的SortedDictionary似乎连更好
The SortedDictionary seems even better.
这篇关于C#替代了C ++ STL集合< T>的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!