Stack (abstract Data Type) - Abstract Definition

Abstract Definition

A stack is a basic computer science data structure and can be defined in an abstract, implementation-free manner, or it can be generally defined as a linear list of items in which all additions and deletion are restricted to one end that is Top.

This is a VDM (Vienna Development Method) description of a stack:

Function signatures:

init: -> Stack push: N x Stack -> Stack top: Stack -> (N U ERROR) remove: Stack -> Stack isempty: Stack -> Boolean

(where N indicates an element (natural numbers in this case), and U indicates set union)

Semantics:

top(init) = ERROR top(push(i,s)) = i remove(init) = init remove(push(i, s)) = s isempty(init) = true isempty(push(i, s)) = false

Read more about this topic:  Stack (abstract Data Type)

Famous quotes containing the words abstract and/or definition:

    What is important, then, is not that the critic should possess a correct abstract definition of beauty for the intellect, but a certain kind of temperament, the power of being deeply moved by the presence of beautiful objects.
    Walter Pater (1839–1894)

    It is very hard to give a just definition of love. The most we can say of it is this: that in the soul, it is a desire to rule; in the spirit, it is a sympathy; and in the body, it is but a hidden and subtle desire to possess—after many mysteries—what one loves.
    François, Duc De La Rochefoucauld (1613–1680)