home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ledar34.zip / leda-r-3_4_tar / LEDA-3.4 / prog / prio / prio.c < prev   
C/C++ Source or Header  |  1996-09-03  |  436b  |  30 lines

  1. #include <LEDA/prio.h>
  2.  
  3.  
  4. //void show(priority_queue<double,string> Q)
  5.  
  6. void show(priority_queue<double,string>& Q)
  7. { pq_item it;
  8.   while (!Q.empty())
  9.   { it = Q.find_min();
  10.     cout << "delete: " << Q.key(it) << " " << Q.inf(it) << "\n";
  11.     Q.del_item(it);
  12.    }
  13. }
  14.  
  15. main()
  16.  
  17. { priority_queue<double,string> Q;
  18.   double r;
  19.  
  20.   while (cin >> r) Q.insert(r,string("inf = %f",r));
  21.  
  22.   show(Q);
  23.   newline;
  24.  
  25.   show(Q);
  26.   newline;
  27.  
  28.   return 0;
  29. }
  30.