List (abstract Data Type)

List (abstract Data Type)

In computer science, a list or sequence is an abstract data type that implements an ordered collection of values, where the same value may occur more than once. An instance of a list is a computer representation of the mathematical concept of a finite sequence. Each instance of a value in the list is usually called an item, entry, or element of the list; if the same value occurs multiple times, each occurrence is considered a distinct item.

The name list is also used for several concrete data structures that can be used to implement abstract lists, especially linked lists.

The so-called static list structures allow only inspection and enumeration of the values. A mutable or dynamic list may allow items to be inserted, replaced, or deleted during the list's existence.

Many programming languages provide support for list data types, and have special syntax and semantics for lists and list operations. A list can often be constructed by writing the items in sequence, separated by commas, semicolons, or spaces, within a pair of delimiters such as parentheses '', brackets, '', braces '{}', or angle brackets '<>'. Some languages may allow list types to be indexed or sliced like array types. In object-oriented programming languages, lists are usually provided as instances of subclasses of a generic "list" class. List data types are often implemented using arrays or linked lists of some sort, but other data structures may be more appropriate for some applications. In some contexts, such as in Lisp programming, the term list may refer specifically to a linked list rather than an array.

In type theory and functional programming, abstract lists are usually defined inductively by four operations: nil that yields the empty list, cons, which adds an item at the beginning of a list, head, that returns the first element of a list, and tail that returns a list minus its first element. Formally, Peano's natural numbers can be defined as abstract lists with elements of unit type.

Read more about List (abstract Data Type):  Operations, Characteristics, Implementations, Programming Language Support, Applications, Abstract Definition

Famous quotes containing the words list and/or data:

    A man’s interest in a single bluebird is worth more than a complete but dry list of the fauna and flora of a town.
    Henry David Thoreau (1817–1862)

    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)