(Collection|Container) Data Type (Set, Bag, Sequence)

1 - About

A collection is a abstract data type for grouping together multiple values.

It's therefore sometime known as a container and creates a aggregation relationship

A collection is:

  • an object that groups multiple elements into a single unit.
  • just a grouping of some objects with the same type.

Once the data has been put in a collection, the data has been aggregated and we get aggregate data

Collections are used to store, retrieve, manipulate, and communicate aggregate data.

The inverse of a collection (ie a single element) is called a scalar.

3 - Management

3.1 - Type

3.1.1 - Primary

An array is a collection structure that is used to implement [#abstract|abstract collection]].

3.1.2 - Abstract

The Primary abstract data type are base on this two properties:

  • ordering mater: Ie (A,B) is not the same than (B,A)
  • unique: allow or not duplicate

Collection that can be seen as a set

Ordering matter Allow duplicate Collection Abstract Type
Set of elements
false false Set
false true Bag (multiset)
true true Sequence (list)
true false OrderedSet
Set of Key/Pair elements (Properties are for the key)
false false Map
false true Multimap

3.1.3 - Mixed / Derived

  • A tree is a collection of a collection. <note tip>Most of the collection are implemented via a tree structure to permit a fast access</note>
  • A queue or stack is a sequence where the extraction of elements is determined by the notion of first or last
  • A graph is set of node and a set of edge.
  • A string is a sequence of character

3.2 - Operations

Standard Operations on collection are defined in functional programming

4 - Documentation / Reference

Data Science
Data Analysis
Data Science
Linear Algebra Mathematics

Powered by ComboStrap