31.01.2014 Views

Version 5.0 The LEDA User Manual

Version 5.0 The LEDA User Manual

Version 5.0 The LEDA User Manual

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

2.3.3 Implementation Parameters<br />

Many of the parameterized data type templates (, e.g., dictionary, priority queue, d array,<br />

and sortseq) take an optional data structure parameter for choosing a particular implementation<br />

(, e.g., d array). We can easily modify the example program from<br />

Section 2.1 to use a dictionary array implemented by a particular data structure, e.g.,<br />

skip lists, instead of the default data structure (cf. Section 18.1).<br />

#include <br />

#include <br />

using namespace leda;<br />

using std::cin;<br />

using std::cout;<br />

using std::endl;<br />

int main()<br />

{<br />

d_array<br />

string s;<br />

N(0);<br />

}<br />

while (cin >> s) N[s]++;<br />

forall_defined(s,N)<br />

cout

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!