COIN-OR::LEMON - Graph Library

Changeset 39:28b0d751d29f in lemon-0.x for src/work/bin_heap_demo.cc


Ignore:
Timestamp:
01/27/04 22:23:33 (17 years ago)
Author:
Mihaly Barasz
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@53
Message:

Alap leiras a BinHeap? -rol

BinHeap::state() befejezese

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/work/bin_heap_demo.cc

    r37 r39  
    99class string_int_map;
    1010
     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.
    1116typedef BinHeap<string, double, string_int_map> StrDoubleHeap;
    1217
     
    7984       << heap.topValue() << endl;
    8085
     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
    8199  cout << "heap.size() = "
    82100       << heap.size() << endl;
     
    89107       << (heap.empty()?"true":"false") << endl; 
    90108}
    91 
Note: See TracChangeset for help on using the changeset viewer.