Changeset 39:28b0d751d29f in lemon0.x for src/work/bin_heap_demo.cc
 Timestamp:
 01/27/04 22:23:33 (21 years ago)
 Branch:
 default
 Phase:
 public
 Convert:
 svn:c9d7d8f590d60310b91f818b3a526b0e/lemon/trunk@53
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

src/work/bin_heap_demo.cc
r37 r39 9 9 class string_int_map; 10 10 11 // Egy binaris kupac, ami stringekhez rendelt double ertekeket tarol, 12 // azaz mindig az a string van a tetejen, amihez a legkisebb szam tartozik. 13 // A kupac egy string_int_map tipusu property_map segitsegevel tarolja 14 // a stringek aktualis helyet sajatmagan belul. 15 // Egy olyan stringhez, ami meg nincsen a kupac 1 et kell rendelnunk. 11 16 typedef BinHeap<string, double, string_int_map> StrDoubleHeap; 12 17 … … 79 84 << heap.topValue() << endl; 80 85 86 cout << "heap.state(\"szilva\") = " 87 << heap.state("szilva") << endl; 88 cout << "heap.put(\"szilva\", 0.5);\n"; 89 heap.put("szilva", 0.5); 90 cout << "heap.state(\"szilva\") = " 91 << heap.state("szilva") << endl; 92 cout << "heap.top() = " 93 << heap.top() << endl; 94 cout << "heap.pop();\n"; 95 heap.pop(); 96 cout << "heap.state(\"szilva\") = " 97 << heap.state("szilva") << endl; 98 81 99 cout << "heap.size() = " 82 100 << heap.size() << endl; … … 89 107 << (heap.empty()?"true":"false") << endl; 90 108 } 91
Note: See TracChangeset
for help on using the changeset viewer.