Stacks & Queues
Stacks and Queues are similar ways of holding data.
Stacks
Think of stacks like a stack of chairs. The data is piled up by pushing
the data onto the stack. The data is taken off of the stack by popping.
Queues
Queues are like a line up at the bank. The first piece of data into the queue
if the first piece of data that is taken out of the loop.
Java Implementation of a simple stack:
©2003 C. Whittington