0

I have to implement the minimum priority_queue using vector<char, int>. I am confused with the following code snippet.

priority_queue(int , vector<char, int> , greater<int> pq;

But this is absolutely wrong.

Martin Zabel
  • 3,589
  • 3
  • 19
  • 34
Noob
  • 174
  • 1
  • 2
  • 19
  • Did you posted the right code because at least a closing paranthese is missing? Please give more details where do you need help. – Martin Zabel Feb 27 '16 at 20:21
  • I want to make min heap in which 1st arg. of vector denote the key and 2nd weight . – Noob Feb 27 '16 at 20:38

1 Answers1

0

This should work :

priority_queue<int,vector< pair<char, int> >, greater< pair<char,int> > > PQ;
uSeemSurprised
  • 1,826
  • 2
  • 15
  • 18
  • What do you mean by that you have not inserted any thing in the priority queue there, you are only inserting things in the vector. – uSeemSurprised Mar 05 '16 at 07:42