FIFO
FILO
LILO
FCFS
Put
Create
Assign
Push
Peak
Pop
IndexOutOfBounds
Memory access violation
Underflow
Overflow
Balanced parentheses
지역 변수 저장
Syntax analyzer
Inter-process Communication (IPC)
1
2
3
4
17
-3
-30
-33
5
6
O(1)
O(n)
O(log n)
O(n log n)
Stack의 capacity는 런타임에 변하지 않는다.
컴파일 타임에 capacity가 결정된다.
Dynamic stack에 비해 push/pop이 빠르다.
Overflow가 발생하지 않는다.
O(n^2)
Null pointer exception (NPE)
Segmentation fault
rear + 1
rear - 1
(rear + 1) % CAPACITY
rear % CAPACITY + 1
비교적 쉽게 구현
메모리를 효율적으로 사용
삭제를 빠르게 처리
탐색을 빠르게
Array
List
Heap
Graph
Interrupt handling
Undo operation
Huffman coding
Dijkstra's algorithm
front와 rear 모두에서 삽입과 삭제가 가능한 queue
Doubly linked list로 구현된 queue
삽입은 front에서 이루어지고 rear가 둘로 나뉘어진 queue
직렬로 연결된 두 개의 queue
front로만 push와 pop을 하면 stack이 된다.
rear로만 push와 pop을 하면 queue가 된다.
front로는 push만 하고 rear로는 pop만 하면 queue가 된다.
rear로는 push만 하고 front로는 pop만 하면 queue가 된다.
© Seunggon Kim