简体   繁体   中英

Equivalent of TreeSet in Java to C#.net

I have Java code containing a TreeSet . I want to convert the code to C#.

Which equivalent collection can I use?
If there is none please suggest alternatives.

That would be System.Collections.Generic. SortedSet<T> .

It does have the methods and complexity guarantees that one would expect from a balanced tree-backed data structure. You can find maximum, minimum, iterate through all elements in order, everything.

See Add to SortedSet<T> and its complexity for more on that.

I think there is no treeset in C#.

There was similar question asked in msdn, check that may be useful. http://social.msdn.microsoft.com/forums/en-US/netfxbcl/thread/823c46ca-4a60-4429-a606-e76c3195d4cc/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM