In computer science, a container is a class or a data structurePaul E. Black (ed.), entry for data structure in Dictionary of Algorithms and Data Structures. US National Institute of Standards and Technology.15 December 2004. Accessed 4 Oct 2011. whose instances are collections of other objects. In other words, they store objects in an organized way that follows specific access rules.
The size of the container depends on the number of objects (elements) it contains. Underlying (inherited) implementations of various container types may vary in size, complexity and type of language, but in many cases they provide flexibility in choosing the right implementation for any given scenario.
Container data structures are commonly used in many types of programming languages.
Containers can be characterized by the following three properties:
access, that is the way of accessing the objects of the container. In the case of arrays, access is done with the array index. In the case of stacks, access is done according to the LIFO (last in, first out) order and in the case of queues it is done according to the FIFO (first in, first out) order;
storage, that is the way of storing the objects of the container;
traversal, that is the way of traversing the objects of the container.
Container classes are expected to implement CRUD-like methods to do the following:
create an empty container (constructor);
insert objects into the container;
delete objects from the container;
delete all the objects in the container (clear);
access the objects in the container;
access the number of objects in the container (count).
Containers are sometimes implemented in conjunction with iterators.
Containers may be classified as either single-value containers or associative containers''.
Single-value containers store each object independently. Objects may be accessed directly, by a language loop construct (e.g. for loop) or with an iterator.
An associative container uses an associative array, map, or dictionary, composed of key-value pairs, such that each key appears at most once in the container.
Cette page est générée automatiquement et peut contenir des informations qui ne sont pas correctes, complètes, à jour ou pertinentes par rapport à votre recherche. Il en va de même pour toutes les autres pages de ce site. Veillez à vérifier les informations auprès des sources officielles de l'EPFL.
We teach the fundamental aspects of analyzing and interpreting computer languages, including the techniques to build compilers. You will build a working compiler from an elegant functional language in
En informatique, un conteneur est une structure de données, une classe, ou un type de données abstrait, dont les instances représentent des collections d'autres objets. Autrement dit, les conteneurs sont utilisés pour stocker des objets sous une forme organisée qui suit des règles d'accès spécifiques. On peut implémenter un conteneur de différentes façons, qui conduisent à des complexités en temps et en espace différentes. On choisira donc l'implémentation selon les besoins.
La programmation orientée objet (POO), ou programmation par objet, est un paradigme de programmation informatique. Elle consiste en la définition et l'interaction de briques logicielles appelées objets ; un objet représente un concept, une idée ou toute entité du monde physique, comme une voiture, une personne ou encore une page d'un livre. Il possède une structure interne et un comportement, et il sait interagir avec ses pairs.
En programmation informatique, une collection est un regroupement d'un nombre variable d'éléments de données (éventuellement zéro) qui ont une signification commune pour le problème à résoudre et qui doivent être traités ensemble d'une manière contrôlée. En général, les éléments de données sont du même type ou, dans les langages supportant l'héritage, dérivés d'un type ancêtre commun.
Reusable abstract data types may be implemented in Ada as generic packages. First we will state some design goals, then outline our solution, address its rationale and show why alternatives have to be rejected. The presented design rules have already been applied successfully for implementing a rather wide set of abstract data types.