Dictionary<string, int> dict = new Dictionary<string, int>();
/* populate dictionary */
List<KeyValuePair<string, int>> summaryList = new List<KeyValuePair<string, int>>();
summaryList.AddRange(dict);
summaryList.Sort(
delegate(KeyValuePair<string, int> kvp1, KeyValuePair<string, int> kvp2)
{
return Comparer<int>.Default.Compare(kvp1.Value, kvp2.Value);
}
);
No comments:
Post a Comment