Set (abstract Data Type)

Set (abstract Data Type)

In computer science, a set is an abstract data structure that can store certain values, without any particular order, and no repeated values. It is a computer implementation of the mathematical concept of a finite set. Unlike most other collection types, rather than retrieving a specific element from a set, one typically tests a value for membership in a set.

Some set data structures are designed for static or frozen sets that do not change after they are constructed. Static sets allow only query operations on their elements — such as checking whether a given value is in the set, or enumerating the values in some arbitrary order. Other variants, called dynamic or mutable sets, allow also the insertion and deletion of elements from the set.

An abstract data structure is a collection, or aggregate, of data. The data may be booleans, numbers, characters, or other data structures. If one considers the structure yielded by packaging or indexing, there are four basic data structures:

  1. unpackaged, unindexed: bunch
  2. packaged, unindexed: set
  3. unpackaged, indexed: string (sequence)
  4. packaged, indexed: list (array)

In this view, the contents of a set are a bunch, and isolated data items are elementary bunches (elements). Whereas sets contain elements, bunches consist of elements.

Further structuring may be achieved by considering the multiplicity of elements (sets become multisets, bunches become hyperbunches) or their homogeneity (a record is a set of fields, not necessarily all of the same type).

Read more about Set (abstract Data Type):  Implementations, Type Theory, Language Support, Multiset

Famous quotes containing the words set and/or data:

    All I’m telling you is that that little creature in there has as much right to live as you do. Don’t forget, you invaded his world. You sank a pipe six miles into the ground and when he climbed up you set dogs on him, shot him.
    Richard Fielding, and Lee Sholem. Superman (George Reeves)

    To write it, it took three months; to conceive it three minutes; to collect the data in it—all my life.
    F. Scott Fitzgerald (1896–1940)