Page 1 of 1

help needed for priority queue using stl?

Posted: Fri Dec 31, 2004 8:49 pm
by harry
i want to insert two types of value in a proirity q using stl.

the problem is shown in the follwing example:

10 1
100 2
12 4
1000 3

so if i call q.top() then it will be 1000.
now i also want to get the position of 1000 which is 3.
how can i get it.
details information will be helpful.
thanks in advanced.

Posted: Sat Jan 01, 2005 9:20 am
by shamim
Use struct and define necessary functions which determines the sorting order of struct type.

For details look into http://www.sgi.com/tech/stl/

Posted: Sat Jan 01, 2005 10:28 am
by harry
thanks for the reply.
i have got the website.
but i could not find any help what i needed.
so i asked for help in the board.

can u explain how can i do that.
one thing i want to use priority queue