반응형
Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | ||||
| 4 | 5 | 6 | 7 | 8 | 9 | 10 |
| 11 | 12 | 13 | 14 | 15 | 16 | 17 |
| 18 | 19 | 20 | 21 | 22 | 23 | 24 |
| 25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- routes
- leetcode
- MySQL
- nodeJS
- BinaryTree
- bit
- component
- state
- route
- css
- count
- node.js
- 비트연산
- treenode
- UE5
- server
- DP
- Navigation
- queue
- map
- Callback
- Props
- array
- event
- c++
- JSX
- Context
- axios
- priority_queue
- React
Archives
- Today
- Total
목록PriorityQueue (1)
우사미 코딩
[C++] priority_queue 우선순위큐
queue는 FIFO (First In First Out) 로 먼저 들어온 데이터가 우선적으로 삭제하는 자료구조이지만 priority_queue는 삽입된 순서와 관련없이 우선순위가 높은 데이터를 삭제하는 자료구조이다 오름차순, 내림차순 queue를 사용해야 할 때가 있는데 이때 priority queue를 사용한다. priority_queue를 사용하려면 queue를 include 해야한다. #include 1. 값이 높은 숫자가 우선적으로 삭제되는 queue priority_queue lessQ; lessQ.push(3); lessQ.push(2); lessQ.push(1); lessQ.push(6); lessQ.push(8); lessQ.push(7); lessQ.pop(); // 8삭제 lessQ...
Programming (C++)/C++ 자료구조
2023. 5. 11. 05:40