C++中优先队列的priority_queue<int,vector<int>,greater<int>>与priority<int>的用法
C++中的优先队列是由二叉堆实现的。默认是使用大根堆实现。优先队列的基本操作:empty()如果队列为空返回真pop()删除队顶元素push()入队一个元素size()返回优先队列中拥有的元素个数top()返回优先队列队顶元素1.priority_queue是默认的大根堆实现,top()是当前优先队列的最大值。#include#includeusingnamespacestd;intmy_arra