Stacks


Introduction

When the president needs a report from the general manager, and the general manager needs some data from the field supervisor, and the field supervisor needs you to retrieve some documents, in what order does everyone get what they want?  Does it happen in the order of initiation, or has the order been reversed?  When was the last time you got to talk to the president?

The above is an example of a last-in, first-out or LIFO list.  Sometimes these structures exist because it doesn't matter which one is used next (e.g. a stack of dinner plates at a buffet line), and sometimes they exist because it is critically important that all of the sub-tasks at each level are completed before returning to the previous level (e.g. see above).  LIFO lists are known more simply as stacks.
 

Resources

Back to Main Menu