sorteddictionary排序的问题
SortedDictionary<string, int> freq = new SortedDictionary<string, int>();现在freq中的数据为
key value
中共 4
干部 1
准则 2
廉政 3
发布 2
怎样利用SortedDictionary的排序功能排序输出为
中共 4
廉政 3
发布 2
准则 2
干部 1 --------------------编程问答-------------------- freq 先 ToList 然后再Sort --------------------编程问答-------------------- 能具体点 来个实例什么的 谢谢
--------------------编程问答-------------------- SortedDictionary<int, string> freq =new SortedDictionary<int, string>();
freq.Add(3, "");
freq.Add(1, "");
freq.Add(2, "");
foreach (int vKey in freq.Keys)
Console.WriteLine(freq [vKey]); --------------------编程问答-------------------- 反问一句 要是SortedDictionary <string, int>这种情况下
根据int排序然后输出string呢
补充:.NET技术 , C#