c# - 集合无重复且有序

标签 c# .net data-structures

我需要一个不包含重复项且项目有序的集合。 我知道 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/

相关文章:

c# - 将成员从类列表复制到 C# 中的字符串列表

c# - 在 .NET 中序列化对象时省略所有 xsi 和 xsd 命名空间?

asp.net - 从 ASP.NET MVC 4 中的部分或编辑器模板触发包包含

Javascript : where are high level data structures?

android - 如何优化在我的 Android 应用程序中加载大量字符串?

c# - 用于更改项目条例的自定义排序算法

c# - Dynamics CRM 2011 Online、CrmSvcUtil、代理服务器身份验证失败

c# - 是否可以同步调用异步调用?

c# - 获取应用程序文件夹路径的最佳方法

data-structures - 链表树