3 ms·
A stack is an abstract type having two operations: push(element) and pop(). The implementation can cheat till it's transparent to the user. To quote CLRS, The
by topkekz 10y ago
A stack is an abstract type having two operations: push(element) and pop(). The implementation can cheat till it's transparent to the user. To quote CLRS,
The INSERT operation on a stack is often called PUSH, and the DELETE operation, which does not
take an element argument, is often called POP. These names are allusions to physical stacks,
such as the spring-loaded stacks of plates used in cafeterias. The order in which plates
are popped from the stack is the reverse of the order in which they were pushed onto the stack,
since only the top plate is accessible.
- MichaelBurge 10y ago"A stack" is an abstract type, but "The Stack" isn't.
- lacampbell 10y ago"The Stack" of a virtual machine definitely is.