• 优先级队列


       1:  //file :4pqueue-test.cpp
       2:  #include <queue>
       3:  #include <iostream>
       4:  #include <algorithm>
       5:  using namespace std;
       6:   
       7:  int main()
       8:  {
       9:      //test priority queue...
      10:      int ia[9] = {0,1,2,3,4,8,9,3,5};
      11:      priority_queue<int> ipq(ia,ia+9);
      12:      cout << "size=" << ipq.size() << endl;
      13:   
      14:      for (unsigned i=0; i<ipq.size();i++)
      15:      {
      16:          cout << ipq.top() << ' ';
      17:      }
      18:      
      19:      cout << endl;
      20:   
      21:      while (!ipq.empty())
      22:      {
      23:          cout << ipq.top() << ' ';
      24:          ipq.pop();
      25:      }
      26:      cout << endl;
      27:      return 0;
      28:  }
  • 相关阅读:
    info plist各个功能的详解
    打个测试包弄成连接供别人下载测试
    封装的数据请求加上风火轮的效果
    福大软工 · BETA 版冲刺前准备(团队)
    福大软工 · 第十一次作业
    Alpha 冲刺 (10/10)
    Alpha 冲刺 (9/10)
    Alpha 冲刺 (8/10)
    Alpha 冲刺 (7/10)
    Alpha 冲刺 (6/10)
  • 原文地址:https://www.cnblogs.com/justinzhang/p/2667213.html
Copyright © 2020-2023  润新知