헤더 파일 : <queue>
특징 |
---|
- 큐에 있는 원소를 처리할 때 가장 먼저 들어온 원소를 먼저 처리하는 것이 아닌 우선순위가 가장 높은 원소가 먼저 처리된다. |
생성자
priority_queue <data_type, container_type, sorting_type> priority_queue_name
Function | Description |
---|---|
.push(value) | 맨 뒤에 value 삽입 |
.pop() | 우선순위가 가장 높은 원소 삭제 (기본은 가장 높은 값) |
.size() | 원소의 개수 반환 |
.empty() | 비었을 시 true 반환 |
.top() | 우선순위가 가장 높은 원소 반환 |
.swap(another_priority_queue) | another_priority_queue와 바꿈 |