priority_queue<int>
时间: 2023-08-21 21:11:19 浏览: 120
编写优先队列数据(priority_queue)
5星 · 资源好评率100%
priority_queue<int>是一个优先队列,用于存储int类型的数据。默认情况下,它是一个降序队列,即数字大的优先级越大。你可以使用priority_queue<int> q;来定义一个int类型的优先队列。你可以使用q.push(x)将元素x插入队列中,使用q.top()获取队列中的最大元素。
#### 引用[.reference_title]
- *1* [[转]c++优先队列(priority_queue)用法详解](https://blog.csdn.net/weixin_30458043/article/details/98156240)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^koosearch_v1,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [priority_queue 的常见用法详解](https://blog.csdn.net/weixin_52914088/article/details/119718611)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^koosearch_v1,239^v3^insert_chatgpt"}} ] [.reference_item]
- *3* [c++ priority_queue用法 入门必看 超详细](https://blog.csdn.net/weixin_52115456/article/details/127606811)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^koosearch_v1,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文