Learn C++ STL

Lesson 3 of 9 · stack and queue: Last In First Out, First In First Out

Module 6 · stack and queue: Last In First Out, First In First Out

Full Programs: From Reversing a Line to a Shortest Path

Free with an accountReading

You have met every shape in this lesson already, just without names. A sentence read backwards, brackets in code, Ctrl+Z (undo), a printer's jobs and a maze: each is a stack or a queue. Six programs follow, each a little bigger. Read the "new thing" line above each one first; it is what that program is for.

Checking what this lesson needs for you…

What is inside Full Programs: From Reversing a Line to a Shortest Path

  1. Program 1: a line, backwards
  2. Program 2: are the brackets balanced?
  3. Program 3: undo in a drawing app
  4. Program 4: Maria's print queue
  5. Program 5: the fewest steps through a mazeIntermediate
  6. Program 6: a browser's Back and ForwardIntermediate