I'm trying to implement Huffman coding by saving letters and their corresponding values into a map then inserting the map into a priority queue. I am getting a parameter conversion error when I try to declare my queue. What exactly am I supposed to put as the parameters? What I have here was my best guess.
void main()
{
ifstream doc("doc.txt");
map<char, int> C;
char letter;
while(!doc.eof()){
doc.get(letter);
if(letter >= 'a' && letter <= 'z')
C[letter]++;
}
priority_queue<int, map<char,int>, greater<int> > Q(C); //also tried greater<map<char,int>>
/*map<char, int>::const_iterator it;
for(it = C.begin(); it != C.end(); it++)
cout<<it->first<<" "<<it->second<<endl;*/
}
I feel kind of dumb asking this but thorough googling did not get me the answer. Thanks a lot for the help!