January 2011
Intermediate to advanced
1648 pages
70h 30m
English
Everyone knows a stack by now, as seen with call stacks and evaluation stacks. Stacks are last-in, first-out (LIFO) collections. Compare it to a stack of books where it’s (nearly) impossible to get a book other than the one at the top without popping the books on top of it off the stack first. The basic operations are called Push and Pop, and a Peek method allows looking at the top element without popping it off. Figure 16.4 graphically depicts the operation of a stack.
Figure 16.4. Operation of a stack data structure.

To illustrate the use of a stack, take a look at the following code fragment:
Similar to the Queue type, Stack is implemented ...
Read now
Unlock full access