next up previous contents index CD CD Algorithms
Next: Dictionaries Up: Fundamental Data Types Previous: Fundamental Data Types

Containers

Containers are abstract data types that hold stuff. They don't do much more than hold it so that it can be retrieved later. Still, they are critical to the functioning of society. We will use the term container to denote a data structure that permits storage and retrieval of data items independently of content. The two fundamental operations of any container are:  

Containers are typically most useful when they will contain only a limited number of items and when the retrieval order is predefined or irrelevant. The most popular type of containers are:

Each of these containers can be implemented using either arrays or linked lists. With the exception of tables, the choice of lists versus tables probably doesn't matter very much. The key issue is whether an upper bound on the size of the container is known in advance, thus permitting a statically allocated array. Using arrays, put and get can be implemented in constant time per operation for each of the containers.  


next up previous contents index CD CD Algorithms
Next: Dictionaries Up: Fundamental Data Types Previous: Fundamental Data Types

Algorithms
Mon Jun 2 23:33:50 EDT 1997