prio.c
Upload User: gzelex
Upload Date: 2007-01-07
Package Size: 707k
Code Size: 0k
Development Platform:

MultiPlatform

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