priority_queue

#inculde  // 优先队列的头文件

priority_queue, less>maxHeap;  // 大顶堆
priority_queue, greater>minHeap; // 小顶堆

maxHeap.push(num);
maxHeap.top();
maxHeap.pop();
maxHeap.empty();
maxHeap.size();

你可能感兴趣的:(priority_queue)