Java TreeMap equivalent in C#?

折月煮酒 提交于 2020-01-01 04:15:13

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!