S
Steve Edwards
Hi,
I'm using a map with the key of type string, and value of type int.
typedef map<string, int, less<string> >concordance;
I'm finding words within some text and keeping a count of their
frequency.
I'm new to STL, but I've just read through the headers and can't see a
way to sort the results by value. (Maybe there's a way to modify less<>?)
Or... Should I create a second multimap (a copy) and have the int as the
key, and the string as the value, and then trivaially keep that sorted.
Or am I just using inappropriate container types to start with?
As I'm dealing with very large text files, speed is a concern too.
Thanks
Steve
I'm using a map with the key of type string, and value of type int.
typedef map<string, int, less<string> >concordance;
I'm finding words within some text and keeping a count of their
frequency.
I'm new to STL, but I've just read through the headers and can't see a
way to sort the results by value. (Maybe there's a way to modify less<>?)
Or... Should I create a second multimap (a copy) and have the int as the
key, and the string as the value, and then trivaially keep that sorted.
Or am I just using inappropriate container types to start with?
As I'm dealing with very large text files, speed is a concern too.
Thanks
Steve