//CIS 610-251: Queues and Link Lists //Assignment # 4 Question # 5 //Due Oct 14,1999 //Pripority Queue unordered. #include #define MAX 5 class Queue { private: int * queue; int rear,front,total; int Remove(void); public: int pqMinDelete(void); bool Insert(int); void Empty(); bool isEmpty(); Queue(); }; Queue::Queue() { queue=new int[MAX]; rear=front=total=0; } //EnQueue an integer n. Successful insertion return true; bool Queue::Insert(int n) { if (rear==MAX-1) { if (front==0) return false; else {rear=0;queue[rear]=n;total++;} } else { if (rear+1 == front) return false; else { rear++; queue[rear]=n; total++; } } return true; } //DeQueue an integer and return it. int Queue::pqMinDelete() { if (!isEmpty()) { int arr[MAX],i=0,j=0,temp=0,tot=total; for(;iarr[i]) {temp=arr[i];arr[i]=arr[j];arr[j]=temp;} } } for(i=0;i