큐 (Queue)
먼저 추가된 요소가 먼저 제거되는 FIFO 구조.
A queue is an abstract data type where elements are added at the back (enqueue) and removed from the front (dequeue). It mimics real-world waiting lines and is vital for asynchronous tasks, printer spooling, and breadth-first search algorithms.
graph LR
Center["큐 (Queue)"]:::main
Rel_stack["stack"]:::related -.-> Center
click Rel_stack "/terms/stack"
Rel_array["array"]:::related -.-> Center
click Rel_array "/terms/array"
classDef main fill:#7c3aed,stroke:#8b5cf6,stroke-width:2px,color:white,font-weight:bold,rx:5,ry:5;
classDef pre fill:#0f172a,stroke:#3b82f6,color:#94a3b8,rx:5,ry:5;
classDef child fill:#0f172a,stroke:#10b981,color:#94a3b8,rx:5,ry:5;
classDef related fill:#0f172a,stroke:#8b5cf6,stroke-dasharray: 5 5,color:#94a3b8,rx:5,ry:5;
linkStyle default stroke:#4b5563,stroke-width:2px;
🧠 지식 테스트
1 / 1
🧒 5살도 이해할 수 있게 설명
아이스크림을 받기 위해 줄을 서 있다고 상상해 보세요. 줄의 첫 번째 사람이 먼저 받고, 새로운 사람은 뒤에 섭니다. 이것이 큐가 작동하는 방식입니다!
🤓 Expert Deep Dive
Lock-free 큐(Michael-Scott)는 높은 처리량의 동시 액세스를 가능하게 합니다. 원형 버퍼(Ring buffer)는 캐시 효율적입니다. 작업 훔치기(Work-stealing) 큐는 효율적인 병렬 스케줄링을 지원합니다.