Changeset 172:c645f4a2a6ae in lemon0.x for src/work/bin_heap_demo.cc
 Timestamp:
 03/11/04 20:24:28 (18 years ago)
 Branch:
 default
 Phase:
 public
 Convert:
 svn:c9d7d8f590d60310b91f818b3a526b0e/lemon/trunk@245
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

src/work/bin_heap_demo.cc
r105 r172 26 26 return operator[](s); 27 27 } 28 void put(const string &s, int i) {28 void set(const string &s, int i) { 29 29 operator[](s) = i; 30 30 } … … 46 46 heap.push("alma", 15); 47 47 48 cout << "heap. put(\"korte\", 3.4);\n";49 heap. put("korte", 3.4);48 cout << "heap.set(\"korte\", 3.4);\n"; 49 heap.set("korte", 3.4); 50 50 51 51 cout << "heap.get(\"alma\") = " … … 55 55 cout << "heap.top() = " 56 56 << heap.top() << endl; 57 cout << "heap.top Value() = "58 << heap.top Value() << endl;57 cout << "heap.topPrio() = " 58 << heap.topPrio() << endl; 59 59 60 60 cout << "heap.decrease(\"alma\", 1.2);\n"; 61 heap. put("alma", 1.2);61 heap.set("alma", 1.2); 62 62 63 63 cout << "heap.top() = " 64 64 << heap.top() << endl; 65 cout << "heap.top Value() = "66 << heap.top Value() << endl;65 cout << "heap.topPrio() = " 66 << heap.topPrio() << endl; 67 67 68 cout << "heap. put(\"alma\", 22);\n";69 heap. put("alma", 22);68 cout << "heap.set(\"alma\", 22);\n"; 69 heap.set("alma", 22); 70 70 71 71 cout << "heap.top() = " 72 72 << heap.top() << endl; 73 cout << "heap.top Value() = "74 << heap.top Value() << endl;73 cout << "heap.topPrio() = " 74 << heap.topPrio() << endl; 75 75 76 76 cout << "heap.size() = " … … 81 81 cout << "heap.top() = " 82 82 << heap.top() << endl; 83 cout << "heap.top Value() = "84 << heap.top Value() << endl;83 cout << "heap.topPrio() = " 84 << heap.topPrio() << endl; 85 85 86 86 cout << "heap.state(\"szilva\") = " 87 87 << heap.state("szilva") << endl; 88 cout << "heap. put(\"szilva\", 0.5);\n";89 heap. put("szilva", 0.5);88 cout << "heap.set(\"szilva\", 0.5);\n"; 89 heap.set("szilva", 0.5); 90 90 cout << "heap.state(\"szilva\") = " 91 91 << heap.state("szilva") << endl;
Note: See TracChangeset
for help on using the changeset viewer.