#include #include #include
Using namespace std;
Struct RoutenodePath () {} RoutenodePath ()} RoutenodePath (int x, int y, int z, int o): _inroadno (x), _ OUTROADNO (Y), _ flagstation (z), _ miles (o) {} inline friend Operator == ( const RouteNodePath & p, const RouteNodePath & r) {return p._miles == r._miles;} inline friend operator <(const RouteNodePath & p, const RouteNodePath & r) {return p._miles _path;};
INT main () {/ * test 1 * / // int} [9] = {0, 23, 0, 5, 634, 63, 64, 64, 6}; // priority_queue IPQ (IA, IA 9 ); // cout << "size =" << ipq.size () << endl; // file: // Result: // file: // size = 9 // // for (int i = 0; I <= ipq.size (); i) // cout << ipq.top () << '; // cout << endl; // file: // Result: // File: // 634 634 634 634 634 634 634 634 634 634 // // While (! Ipq.empty ()) // {// cout << ipq.top () << ''; // ipq.pop (); // } // file: // Result // File: // 634 64 64 63 23 6 5 0 0 // // Cout << endl; / * test 2 * / priority_queue rnodepath; rnodepath.push (routenodepath) 1, 2, 3, 440)); RnodePath.push (RoutenodePath (2, 3, 1, 810)); RnodePath.push (RoutenodePath (3, 4, 3, 1040); RnodePath.push (RoutenodePath (5, 1, 3, 1440); RNODEPATH.PUSH (RoutenodePath (2, 3, 3, 240); RoutenodePath AA = RNODEPATH.TOP (); cout << aa._miles << Endl;
/ * Test 3 * / priority_queue rnodepath2; const RouteNodePath * rnodepathpt = & (rnodepath.top ()); rnodepath2.push (* rnodepathpt); RouteNodePath bb = rnodepath.top (); cout << bb._miles <