Container (abstract Data Type) - Overview

Overview

Containers can be studied under three points of views.

  1. Access : It means accessing the container elements. In the case of arrays, accessing is done with the array index. For stacks, access of elements is done using LIFO (Last In First Out) (alternative name FILO (First In Last Out) and in queues it is done using FIFO (First In First Out).
  2. Storage : It includes storing of items of containers. Some containers are finite containers and some are infinite containers.
  3. Traversal : It includes how the item can be traversed.

Container classes are expected to implement methods to do the following:

  • create a new empty container (constructor),
  • report the number of objects it stores (size),
  • delete all the objects in the container (clear),
  • insert new objects into the container,
  • remove objects from it,
  • provide access to the stored objects.

Containers are sometimes implemented in conjunction with iterators.

Read more about this topic:  Container (abstract Data Type)