QUEUE란?
FIFO
(First In First Out) 특성을 가지는 자료구조.
- Ordered linear list.
- One end is called front.(dequeue는 여기서)
- Other end is called rear.(enqueue는 여기로)
- Additions are done at the rear only.
- Removals are made from the front only.
Queue Operations
- IsFullQ ...return true iff queue is full
- IsEmptyQ ...return true iff queue is empty
- AddQ ...add an element at the rear of the queue
- DeleteQ ...delete and return the front element of the queue.
Circular Queue
장점: 1D array 큐에서 dequeue를 했을 때 생기는 메모리 낭비를 막을 수 있음.
rear = (rear+1) % M(array 공간의 개수)