Hi, I know what's Heap, HeapSort, I know the ways of implementing this data structure. But know I would like to use the STL priority_queue instead, so that STL will do the job of implementing for me. However, I came across a problem, which is that I don't know how to adjust the priority_queue, so that it stores more complicated types. Such as
1 2 3 4 5
typedefstruct {
int No1;
int No2;
// ... etc.
} moreComplicatedType;
I want it to store only according to (for example) No1. Is there a way I can set up a compare function or something like that?