lazlo
December 10th, 2002, 10:22 PM
Greetings
I was wondering if someone could could help me out with a problem concerning heaps. I have a vector of a struct that contains a string and a int i.e.
typedef struct wordusage
{
string word;
int num;
};
I want to create a heap based on the integer so I can easily find the largest "num"s in the vector. make_heap of course won't operate on my struct, so how can I heap the int without losing its corresponding string?
I was wondering if someone could could help me out with a problem concerning heaps. I have a vector of a struct that contains a string and a int i.e.
typedef struct wordusage
{
string word;
int num;
};
I want to create a heap based on the integer so I can easily find the largest "num"s in the vector. make_heap of course won't operate on my struct, so how can I heap the int without losing its corresponding string?