我用linked list 黎做, 但係 dequeue 果時有error, 會沒有回應
幫我睇下有咩問題
int getItem(circularQueue_t *theQueue, int *theItemValue)
{
if(isEmpty(theQueue))
{
printf("isempty\n");
return(-1);
}
else
{
*theItemValue=theQueue->data[theQueue->first];
theQueue->first=(theQueue->first+1)%MAX_ITEMS;
theQueue->validItems--;
return(0);
}
}