home *** CD-ROM | disk | FTP | other *** search
- #include <LEDA/PRIO_M.h>
-
- #include <LEDA/rb_tree.h>
-
-
- declare2(prio,int,int)
-
- declare3(PRIO,int,int,rb_tree)
-
-
-
- void TEST(prio(int,int)& P)
- {
- int x;
- while ((cin >> x) && (x > 0)) P.insert(x,x);
-
- pq_item it;
- forall_pq_items(it,P) cout << P.key(it) << " " << P.inf(it) << "\n";
- newline;
-
- }
-
-
-
- main()
- { prio(int,int) Q;
- PRIO(int,int,rb_tree) R;
-
- pq_item it;
-
- TEST(Q);
- forall_pq_items(it,Q) cout << Q.key(it) << " " << Q.inf(it) << "\n";
- newline;
-
- TEST(R);
- forall_pq_items(it,R) cout << R.key(it) << " " << R.inf(it) << "\n";
- newline;
-
- int x;
- while ((cin >> x) && (x > 0)) R.insert(x,x);
- forall_pq_items(it,R) cout << R.key(it) << " " << R.inf(it) << "\n";
- newline;
-
- }
-