Introduction to the Stack Data Structure

Introduction

A stack is one of the simplest and most widely used data structures in computer science. It stores a collection of items but deliberately restricts how you interact with them: you may only add or remove at one end, called the top. That single restriction produces the Last-In, First-Out (LIFO) ordering that gives stacks their character — the most recently added item is always the first one to leave.

In this module we build toward implementing a Stack class ourselves, so it matters that you first understand the stack conceptually, independent of any code. That is the idea behind treating a stack as an Abstract Data Type (ADT): we specify the operations it must support — push, pop, peek, isEmpty, size — and the rules governing their behavior, and only afterward decide whether an array, a linked list, or something else will hold the data underneath.

As you watch, pay attention to three things. First, how each video describes what happens to the top of the stack during push and pop. Second, the distinction between the interface (what operations exist and what they promise) and the implementation (how they are carried out). Third, any mention of where stacks appear in real systems — function call stacks, undo features, backtracking — since those use cases return later in the module.

Video 1: Lec-30: Introduction to Stack | PUSH and POP operations | Data Structure

Gate Smashers · 6:46 · 325,602 views · 3y ago · captions — Watch on YouTube

About this video

A lecture-style introduction to the stack that defines the structure and walks through the PUSH and POP operations, the two fundamental ways to modify a stack. Based on its title and format, it should illustrate the LIFO ordering with step-by-step examples of items entering and leaving the top of the stack, and likely touches on conditions such as overflow and underflow that arise when a stack is full or empty.

Why this video

Gate Smashers produces exam-oriented data structures lectures, and this short, highly viewed video gives a clear and concrete first pass at the What Is a Stack?, LIFO Principle, and Core Stack Operations subtopics before you see any code.

Video 2: ADTs and Data Structures

Professor Kevin Wortman · 8:03 · 416 views · 5y ago · captions — Watch on YouTube

About this video

This video explains the general concept of an Abstract Data Type and how ADTs are used to define and categorize data structures. Expect a discussion of the separation between the operations a type promises to support and the concrete mechanism that implements them, with accompanying slides.

Why this video

It supplies the vocabulary behind the Stacks as an Abstract Data Type subtopic, taught by a computer science professor in a short, lecture-slide format that makes the interface-versus-implementation distinction explicit.

Video 3: Stack Abstract Data Type

Professor Kevin Wortman · 5:07 · 409 views · 5y ago · captions — Watch on YouTube

About this video

A focused follow-up that applies the ADT framework specifically to the stack, defining the stack ADT and the operations it specifies. In roughly five minutes it should lay out the formal description of stack behavior rather than any one language's implementation.

Why this video

Watched after the general ADT video, it directly connects the abstract specification to the stack itself, which is exactly the conceptual foundation this topic is meant to establish before implementation work begins.

How These Videos Support the Learning Outcomes

Together these videos build the conceptual base the module's outcomes depend on. The Gate Smashers lecture establishes LIFO ordering and the push/pop operations, supporting MO1 and giving you the behavioral model you will later encode as methods for MO2. The two Professor Wortman videos frame the stack as an Abstract Data Type, which is the mindset behind MO3: once the required operations are specified independently of storage, you can reason about whether an array or a linked list best implements them and at what cost. The operation-level understanding gained here is also the prerequisite for the applied outcomes MO4 and MO5, where stack behavior is used to evaluate expressions and to explain features such as undo, browser history, and call stacks.

About These Videos

These videos were chosen from YouTube on October 2, 2026. Each has captions; the player turns them on. Videos on YouTube can be changed or removed — if one no longer plays, tell your instructor. If a player does not appear, use its Watch on YouTube link.