I'm examining a selection of text and storing attributes about the
frequency of letter combinations in it. Initially, I assumed I would
use a std::map to record letter-combinations -frequency as the key -
value pair. However, I also need to sort by frequency (the value)once the analysis is done, so std::map seems to be out since map can't
sort by value. (Grrr!) Given that I want to store by key, but later
sort by value, what method should I use?
BTW, speed is critical. I'll literally be doing this operation full-
bore for hours at a time, so my thought was that the obvious solution
of creating a key-value-swapped multimap from the map once I'm done
seems kinda expensive. If this is not as bad as I'm thinking it will
be, or if there's no better way, please let me know that too.
Thanks,
Bill