by Jamie Dixon
on Stack Overflow
See other posts from Stack Overflow
or by Jamie Dixon
Published on 2010-06-13T22:41:24Z Indexed on 2010/06/13 22:52 UTC
Read the original article Hit count: 475
When talking about a stack in either computing or "real" life we usually assume a "first on, last off" type of functionality.
Because the idea of a stack is based around something in the physical world, does it matter how the data in the stack is stored?
I notice in a lot of examples that the storage of the stack data is quite often done using an array and the newest item added to the stack is placed at the bottom of the array. (like adding a new plate to an existing stack of plates except putting it underneath the other plates rather than on top).
As a paradigm, does it matter in what order the data is stored within the stack as long as the operation of the stack acts as expected?
© Stack Overflow or respective owner