/* queue1a.c++ implementation of int queue */ #include "queue1a.h" queue::queue() { front = rear = count = 0; } int queue::isFullQ(){ return count == MAX; } int queue::isEmptyQ(){ return count == 0; } int queue::addQ(int n){ int temp, i; if(isFullQ()) return ERROR; rear = (rear + 1) % MAX; data[rear] = n; // count = count+1; temp = count; for(i=1; i<= 500000; ++i); // Delay temp = temp+1; count = temp; return OK; } int queue::deleteQ(int &v){ int temp, i; if(isEmptyQ()) return ERROR; v = data[(front+1)%MAX] ; front = (front+1)%MAX; // count = count - 1; temp = count; for(i=1; i<= 500000; ++i); // Delay temp = temp-1; count = temp; return OK; }