본문내용
//0을 입력 할 경우 입력 종료
}
void enqueue(int item) //큐에 원소 저장 , 큐가 꽉 찼을 경우 오류 메세지 출력
{
if(count == SIZE){
printf("\n\nFULL QUEUE\n\n");
}else {
queue[rear] = item;
rear = ++rear % SIZE;
++count;
}
}
int dequeue(void) //큐에서 원소 제거후 값 리턴, 큐에 원소가 없을 경우 (-1)리턴
{
int front_value;
if(count == 0) return(-1);
front_value = queue[front];
front = ++front % SIZE;
--count;
return(front_value);
}
6. 프로그램 실행 결과
}
void enqueue(int item) //큐에 원소 저장 , 큐가 꽉 찼을 경우 오류 메세지 출력
{
if(count == SIZE){
printf("\n\nFULL QUEUE\n\n");
}else {
queue[rear] = item;
rear = ++rear % SIZE;
++count;
}
}
int dequeue(void) //큐에서 원소 제거후 값 리턴, 큐에 원소가 없을 경우 (-1)리턴
{
int front_value;
if(count == 0) return(-1);
front_value = queue[front];
front = ++front % SIZE;
--count;
return(front_value);
}
6. 프로그램 실행 결과
소개글