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
Wrap
C/C++ Source or Header
|
1996-09-03
|
436b
|
30 lines
#include <LEDA/prio.h>
//void show(priority_queue<double,string> Q)
void show(priority_queue<double,string>& Q)
{ pq_item it;
while (!Q.empty())
{ it = Q.find_min();
cout << "delete: " << Q.key(it) << " " << Q.inf(it) << "\n";
Q.del_item(it);
}
}
main()
{ priority_queue<double,string> Q;
double r;
while (cin >> r) Q.insert(r,string("inf = %f",r));
show(Q);
newline;
show(Q);
newline;
return 0;
}