I have a hashtable with different words(key) and the number of times they occur(value).
I want to sort it based on value in such a way that the word which occurs for the most no. of times appears first.How do I do so?
Can you update the outdated hashtable into a generic collection like:
System.Collections.Generic.SortedDictionary<> or
System.Collections.Generic.Dictionary<> ?
This will take all the KeyValuePairs in the dictionary, order them based on their value and finally select just the key component (the string part) and put them in a list.
NOTE: My code snippets are just snippets. They demonstrate an idea which can be adapted by you to solve your problem. They are not 100% complete and fully functional solutions equipped with error handling.
Bookmarks