In computer programming, a collection is an abstract data type that is a grouping of items that can be used in a polymorphic way.
Although easily confused with implementations in programming languages, collection, as an abstract concept, refers to mathematical concepts which can be misunderstood when the focus is on an implementation.
Some collections maintain a linear ordering of items – with access to one or both ends.
For example, a priority queue is often implemented as a heap, which is a kind of tree.
Notable associative collections include: A set can be interpreted as a specialized multiset, which in turn is a specialized associative array, in each case by limiting the possible values—considering a set as represented by its indicator function.