#inculde<queue> // 优先队列的头文件
priority_queue<int, vector<int>, less<int>>maxHeap; // 大顶堆
priority_queue<int, vector<int>, greater<int>>minHeap; // 小顶堆
maxHeap.push(num);
maxHeap.top();
maxHeap.pop();
maxHeap.empty();
maxHeap.size();
#inculde<queue> // 优先队列的头文件
priority_queue<int, vector<int>, less<int>>maxHeap; // 大顶堆
priority_queue<int, vector<int>, greater<int>>minHeap; // 小顶堆
maxHeap.push(num);
maxHeap.top();
maxHeap.pop();
maxHeap.empty();
maxHeap.size();
本文标题:priority_queue
本文链接:https://www.haomeiwen.com/subject/owxhnttx.html
网友评论