问题
Most places I've consulted say to use SortedList, but the problem is that the program I'm porting actually uses duplicate keys (differentiated by order), which is permissible with TreeMap, but not SortedList.
Any advice?
回答1:
Does SortedDictionary class help?
回答2:
Another great implementation of a Red Black Tree in .NET can be found here: http://www.itu.dk/research/c5/
回答3:
I don't think C# has one natively. However there are plenty of examples of Red-Black implementations out there. Here is one:-
http://www.codeproject.com/KB/recipes/redblackcs.aspx
来源:https://stackoverflow.com/questions/477954/java-treemap-equivalent-in-c