Home  

Random  

Nearby  



Log in  



Settings  



Donate  



About Wikipedia  

Disclaimers  



Wikipedia





Collection (abstract data type)





Article  

Talk  



Language  

Watch  

Edit  





Incomputer programming, a collection is an abstract data type that is a grouping of items that can be used in a polymorphic way.

Often, the items are of the same data type such as intorstring. Sometimes the items derive from a common type; even deriving from the most general type of a programming language such as objectorvariant.

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. For example, a priority queue is often implemented as a heap, while an associative array is often implemented as a hash table, so these abstract types are often referred to by this preferred implementation, as a "heap" or a "hash", though this is incorrect conceptually.

Subtypes

edit

Other abstract data types are more specific than collection.

Linear

edit

Some collections maintain a linear ordering of items – with access to one or both ends. The data structure implementing such a collection need not be linear. For example, a priority queue is often implemented as a heap, which is a kind of tree.

Notable linear collections include:

Associative

edit

Some collections are interpreted as a sort of function: given an input, the collection yields an output.

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.

Implementation

edit

As an abstract data type, collection does not prescribe an implementation, though type theory describes implementation considerations.

Some collection types are provided as primitive data types in a language, such as lists, while more complex collection types are implemented as composite data types in libraries, sometimes in a language's standard library. Examples include:

References

edit
  1. ^ Feuerstein, Steven; Pribyl, Bill; Dawes, Chip (2007) [1999]. "Collections in PL/SQL". Oracle PL/SQL Language Pocket Reference. Pocket Reference (4 ed.). Sebastopol, California: O'Reilly Media, Inc. p. 63. ISBN 9780596551612. Retrieved 2017-06-26. Collections are implemented as TYPEs. As with any programmer-defined type, you must first define the type; then you can declare instances of that type.
edit

Retrieved from "https://en.wikipedia.org/w/index.php?title=Collection_(abstract_data_type)&oldid=1231458050"
 



Last edited on 28 June 2024, at 11:32  





Languages

 


Čeština
فارسی
Français
Português
Русский
Українська


 

Wikipedia


This page was last edited on 28 June 2024, at 11:32 (UTC).

Content is available under CC BY-SA 4.0 unless otherwise noted.



Privacy policy

About Wikipedia

Disclaimers

Contact Wikipedia

Code of Conduct

Developers

Statistics

Cookie statement

Terms of Use

Desktop