For dictionaries with very small numbers of bindings, it may make sense to implement the dictionary using an association list, a linked list of bindings. … The most frequently used general purpose implementation of an associative array is with a hash table: an array of bindings, together with a hash function that maps each possible key into an array index. … Dictionaries may also be stored in binary search trees or in data structures specialized to a particular type of keys such as radix trees, tries, Judy arrays, or van Emde Boas trees. …
So I think my problem lies in that I don’t know that associative array (i.e. map, or dictionary) is an abstract data type and hashing table is a concrete data structure, and different concrete data structures can be used to implement the same abstract data type. So my questions would be
- what are the difference and relation between abstract data structures and concrete data structures?
- what examples are for each of them (abstract and concrete data structures)? The more the better.
- Is there a list of what concrete data structures can be used to implement what abstract data structures? It would be nice to have one.
Thanks!
Asked By : Tim
Best Answer from StackOverflow
Question Source : http://cs.stackexchange.com/questions/6678
Answered By : Joe
- A dictionary supports Find(x) queries. For an a key $x$, return the element in the dictionary with key $x$, if such an element exists. A dynamic dictionary also supports Insert(x) and Delete(x). Common implementations of a dictionary include different kinds of balanced binary search trees (e.g. red black tree) and various kinds of hash tables.
- In addition to Find an ADT may require support of successor(x) queries. That is, maintain a set of keys $S$, and given key $x$, find the smallest key $t in S$ such that $s < t$. Concrete data structures which support the Successor ADT include various binary search trees, and more complicated structures such as an X-fast trie or van Emde Boas tree (if the keys are integers).
- A Priority Queue is an ADT that requires insert and delete-min operations (and sometimes other operations as well, such as find-min increase-key or delete-key). Data structures that implement the priority queue ADT include:
- an unsorted linked list, which has fast insert but slow delete-min.
- a sorted linked list which has fast delete-min but slow insert
- a binary search tree, which has logarithmic insert and delete-min, and $sort(n)$ initialization time.
- a binary heap which has logarithmic insert and delete-min, and linear time initialization.
- There are also other variants of heap implementations.
- An interval stabbing ADT maintains a set of intervals on the real line, and supports a stabbing(x) query, which returns the subset of intervals which contain (are stabbed by) the point $x$. Data structures that implement the stabbing query ADT include a Segment Tree and an Interval Tree.