I want to construct a min priority queue to hold class objects eg class vertex { public: vertex *parent; int value; vertex() { parent = NULL; value = rand(); } ~vertex(); }array[10];
priority_queue<vertex> Q; for(i=0;i<9;++i)Q.push(array[i]); the min-heap is to be ordered by the "value" and Q.top() should return the vertex with min value ( like we require in prim's algorithm). Can anybody assist me how to create the priority_queue using STL in C+ + and how is the comparator class and container is to be written for this. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/algogeeks -~----------~----~----~----~------~----~------~--~---