COURSE: DATA STRUCTURES & ALGORITHMS
SECTION 04 // STACKS
C++ DATA STRUCTURES•SPRING
Section 4 — Data Structures

Stacks & LIFO

One open end, one rule: the last element in is the first element out. Build the same contract twice — once on a fixed array, once on a chain of nodes.

WHAT WE'LL COVER16 SLIDES
  1. 01Cover
  2. 02What Is a Stack?
  3. 03The LIFO Sequence
  4. 04std::stack
  5. 05Array Structure
  6. 06Push
  7. 07Pop & Peek
  8. 08Display & Run
  9. 09Overflow & Underflow
  10. 10Linked Structure
  11. 11Pointer Push & Pop
  12. 12Peek & Display
  13. 13Integer Stack Run
  14. 14String Stack Run
  15. 15Array vs. Linked
  16. 16Key Takeaways
C++ · Stack · LIFO · Array · Linked List

Hagar Gamal

Faculty of Computers & Information