Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

#ifndef PRIORITYQUEUE_H #define PRIORITYQUEUE_H #include <vector> using namespace std; #include "graph.

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;

private: typedef vector<vtxRouteInfo_t> mHeap_t }; }} #endif

You might also like