Stack (abstract Data Type) - Inessential Operations

Inessential Operations

In many implementations, a stack has more operations than "push" and "pop". An example is "top of stack", or "peek", which observes the top-most element without removing it from the stack. Since this can be done with a "pop" and a "push" with the same data, it is not essential. An underflow condition can occur in the "stack top" operation if the stack is empty, the same as "pop". Often implementations have a function which just returns if the stack is empty.

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

Famous quotes containing the words inessential and/or operations:

    Poetry presents indivisible wholes of human consciousness, modified and ordered by the stringent requirements of form. Prose, aiming at a definite and concrete goal, generally suppresses everything inessential to its purpose; poetry, existing only to exhibit itself as an aesthetic object, aims only at completeness and perfection of form.
    Richard Harter Fogle, U.S. critic, educator. The Imagery of Keats and Shelley, ch. 1, University of North Carolina Press (1949)

    You can’t have operations without screams. Pain and the knife—they’re inseparable.
    —Jean Scott Rogers. Robert Day. Mr. Blount (Frank Pettingell)