c++ 实例化一个STL优先级队列

From , 5 Years ago, written in C++, viewed 128 times.
URL https://pastebin.vip/view/c164bbc9
  1. // 实例化一个STL优先级队列
  2. #include <queue>
  3.  
  4. int main() {
  5.         using namespace std;
  6.  
  7.         // A priority queue of integers sorted using std::less <> (default)
  8.         priority_queue<int> pqIntegers;
  9.  
  10.         // A priority queue of doubles
  11.         priority_queue<double> pqDoubles;
  12.  
  13.         // A priority queue of integers sorted using std::greater <>
  14.         priority_queue<int, deque<int>, greater<int> > pqIntegers_Inverse;
  15.  
  16.         return 0;
  17. }
  18.  

Reply to "c++ 实例化一个STL优先级队列"

Here you can reply to the paste above

captcha

https://burned.cc - Burn After Reading Website