Stacks & Queues

Welcome to the Stacks & Queues module. You will learn about LIFO and FIFO constraints, Monotonic Stacks, and real-world queuing systems.

1. Module Contents

  1. Introduction to Stacks & Queues

    Understand Stacks (LIFO) and Queues (FIFO). Discover the hardware reality of Push and Pop operations, and learn why recursion is essentially just a Stack.

  2. Stack Operations

    Master Stack operations like Push, Pop, and Peek. Learn how to implement a MinStack in O(1) time and discover why ArrayDeque is superior in modern Java.

  3. Queue Implementations

    Master the FIFO constraints of Queues. Learn to implement Queues using Linked Lists and Ring Buffers (Circular Arrays) while understanding trade-offs.

  4. Monotonic Stack

    Master the Monotonic Stack and Queue patterns to solve Next Greater Element problems in O(N) time with optimal space constraints and implementation details.

  5. Expression Evaluation

    Learn to build an expression evaluator. Master the Shunting-yard algorithm to convert infix expressions to Postfix notation (RPN) using Stacks effectively.

  6. Sliding Window Maximum

    Master the Sliding Window Maximum problem. Learn how to optimize from a naive brute force approach to O(N) using a Monotonic Deque for technical efficiency.

  7. Real World Applications

    Discover real-world uses of Stacks and Queues, including practical implementations for Browser History navigation, Undo/Redo tracking, and API Rate Limiting.

  8. Module Review: Stacks & Queues

    Review everything you learned about Stacks and Queues. Access interactive flashcards, study the complexity cheat sheet, and comprehensively review takeaways.

2. Practice

[!NOTE] Looking for hands-on algorithmic exercises? We have migrated all coding challenges for this module into the Problem Vault to give you a centralized, focused practice environment.