Denion
December 8th, 2004, 05:57 AM
Hi I'm working on a graph assignment for school. I need to implement a priority queue or minheap. I am fairly new to c++. How do you implement a priority que using an abstract data type. For instance I would like to be able to to have an edge * e and a queue q so that I could enque e using its cost value.
Sorry if that didn't make alot of sense:
This won't complie but heres what I'm trying to do:
edge * e = new edge(string routerOne, string routerTwo, int cost);
priority_queue<* edge>*q;
q.enque(e);
I would like to do this so that edge is cost is used to determine priority
Sorry if that didn't make alot of sense:
This won't complie but heres what I'm trying to do:
edge * e = new edge(string routerOne, string routerTwo, int cost);
priority_queue<* edge>*q;
q.enque(e);
I would like to do this so that edge is cost is used to determine priority