Definition
An instance of type _d_array<I,E,impl> is a dictionary array implemented by data type impl. impl must be one of the dictionary implementations listed in section Implementations Dictionaries or a user defined data structure fulfilling the specification given in section User Implementations Dictionaries. Note that depending on the actual implementation impl the index type I must either be linearly ordered or hashed.
Example
Using a dictionary array implemented by hashing with chaining (ch_hash) to count the number of occurences of the elements in a sequence of strings.
#include <LEDA/_d_array.h>
#include <LEDA/impl/ch_hash.h>
//we first have to define a hash function for strings
int Hash(const string& x)
{ return (x.length() > 0) ? x[0] : 0; }
main()
{
_d_array<string,int,ch_hash> N(0);
string s;
while (cin >> s) N[s]++;
forall_defined(s,N)
cout << s << " " << N[s] << endl;
}