CoursesDSA Foundations

Stack & Queue Basics

Lessons
8
Exercises
49
Minutes
49

Start Stacks

  1. 1

    Stacks

    A last-in, first-out structure: push to the top, pop from the top.

    Complete codeDebugCode orderMultiple choiceTapTrace
    6 exercises
    6 min
  2. 2

    Queues

    A first-in, first-out structure: add at the back, remove from the front.

    Complete codeDebugFill blankMultiple choiceTapTrace
    6 exercises
    6 min
  3. 3

    Stacks & Queues CheckpointCheckpoint

    Prove you know LIFO vs FIFO and their operations before moving on to trees.

    Complete codeDebugCode orderFill blankMultiple choiceTapTrace
    7 exercises
    8 min
  4. 4

    Valid Parentheses

    A stack remembers the most recent unclosed opener — every closer must match the top.

    Complete codeMultiple choiceTapTrace
    5 exercises
    5 min
  5. 5

    Min Stack

    Store the min-so-far alongside each element so popping never loses the minimum's history.

    Complete codeMultiple choiceTapTrace
    5 exercises
    5 min
  6. 6

    Queue from Two Stacks

    Two reversals restore original order — refill the out-stack only when it's empty.

    Complete codeMultiple choiceTapTrace
    6 exercises
    5 min
  7. 7

    Stack & Queue ReviewReview

    Revisit the island's big ideas: LIFO vs FIFO, matching brackets with a stack, min-so-far pairs, and the two-stack queue.

    DebugCode orderFill blankMultiple choiceTapTrace
    6 exercises
    6 min
  8. 8

    Boss: Valid ParenthesesBoss

    Solve Valid Parentheses end to end: choose the pattern, assemble the check, trace it, and handle every edge case.

    Complete codeCode orderMultiple choiceTrace
    8 exercises
    8 min