A Review of Stacks and Their Uses

Stacks are a basic data type in the computing world. They store items of data in ordered lists that are typically accessed from one end only in a last-in/first-out manner. A stack is similar to an inbox tray; items are placed on the top (“pushed”) and also removed from the top (“popped”). Figure 7.1 illustrates a simple stack.

Figure 7.1. The workings of a simple stack.

Due to their simplicity and low-level hardware support, stacks are extensively used in most computer architectures. They provide a convenient and efficient means of storing data, usually for short-term use, such as the local variables in a method ...

Get .NET Framework Security now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.