Is there a collection in .Net that only supports sorted values. Don't need keys?
I am looking for something like a tree. We are constantly inserting into an already sorted collection. We would like to access the minimum and maximum values. We don't need any keys, just a value. I couldn't find any tree structures from .Net and I couldn't see anything else similar to what I'm looking for.
+2
a source to share
1 answer
In .NET 4.0 there is a SortedSet - it looks like it will do what you want, and has Min
and Max
properties.
.NET 3.5 does HashSet
, but that only deals with equality, not ordering.
+3
a source to share