Implementing the Dictionary ADT
-
A Dictionary (also known as Table or Map) can be implemented in various ways:
-
using a list, binary search tree, hashtable, etc., etc.
-
In each case:
-
the implementing data structure has to be able to hold key-data pairs
-
the implementing data structure has to be able to do insert, find, and delete operations paying attention to the key
-
The Java Collections Framework has
TreeMap<K,V>
(using a red-black tree) and
HashMap<K,V>
(using a separate chaining hashtable) implementations of the
Map<K,V>
interface
-
The C++ STL has the
std::map<Key,T>
container (using a red-black tree). Current version of STL has no hashing container, though it has been proposed
CONTENTS PREVIOUS NEXT