Professional Documents
Culture Documents
Shortestpath H
Shortestpath H
h" namespace coursera { namespace assign2 { class PriorityQueue { public: // removes the top element of the queue vtxRouteInfo_t minPrioirty (); // changes the priority (node value) of queue element void chgPrioirity (const vtxRouteInfo_t&); // insert queue_element into queue void insert (const vtxRouteInfo_t&); // does the queue contain queue_element bool contains (vNumber_t, vtxRouteInfo_t&) const; // returns the top element of the queue vtxRouteInfo_t top () const; // return the number of VALUE_T size_t size () const; // print priority queue void print (); private: typedef enum heapifyDirection {HEAPIFY_UP, HEAPIFY_DOWN} heapifyDirectio n_t; void void swap (size_t index1, size_t index2); heapify (size_t index, heapifyDirection_t hDir); mHeap_t; mHeap;