Sorted output from an associative array

FG home at fgda.pl
Wed Jan 30 07:43:52 PST 2013


Let's say i have an array: int[string] wordCount.
How to print key:value pairs ordered by descending value?
Or generally how to to store wordCount in an array of structs or type tuples for 
later sorting?

In Python I would use something like this:
sorted(wordCount.items(), key=lambda a: a[1], reverse=True).



More information about the Digitalmars-d-learn mailing list