堆(优先队列)基础

xiaoxiao2021-02-28  65

1.建队列 利用自带的stl模板

#include<queue> priority_queue<int>q; //priorioty_queue<int,vector<int>>,greater<int>q;

2.基本操作

q.pop()//弹出队顶 q.top()//返回队首 q.push(n)//推进队列
转载请注明原文地址: https://www.6miu.com/read-74566.html

最新回复(0)