我需要一个不包含重复项且项目有序的集合
。
我知道 hashSet
包含一个没有重复项的集合。但集合中的项目没有特定的顺序。
我有什么选择? .Net
中是否有可以在 c# 编程
语言中使用的内置列表?
编辑: 该集合也必须是可观察的
我需要使用这个集合来按照MVVM原则与WPF一起工作。
任何observablecollection有序集?
最佳答案
Sorted set可能是您正在寻找的集合。
SortedSet is an ordered set collection. We have many elements and want to store them in a sorted order and also eliminate all duplicates from the data structure. The SortedSet is part of the System.Collections.Generic namespace.
关于c# - 集合无重复且有序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32480697/