Index

Free, with Google

Keep going, free.

A free account opens lessons 2 and 3 of every track, 33 more lessons, and keeps your progress and review cards on every device.

Start free with Google

A chalk plan

Open everything on chalk.

Every lesson, board, video, lab and paper, and the full review decks. Yearly is $39/year.

See plansStart free instead

Module 01 · DSA · The toolbox · about 17 min to read

Play it as a journeyTutor comes with a plan

Linked Lists, Stacks & Queues

Linked Lists Stacks and Queues
Linked Lists Stacks and Queues · Open board

It draws three ways of lining things up, and this lesson tells the story of where each rule for “what goes first” came from. Builds on Arrays & Strings and ties into How Code Becomes Execution (compilers, stack & heap) (the call stack) and The Memory Hierarchy (cache, locality, the memory wall) (why arrays usually beat linked lists).

Before you start. You need one fact from Arrays & Strings: an array keeps its values side by side in memory (why that is the fast kind of memory: The Memory Hierarchy (cache, locality, the memory wall)), so slotting a new one into the middle means sliding every value after it down a slot (Arrays & Strings). Everything below is what people invented to dodge that slide, plus two rules for which item you’re allowed to touch first.

Lesson 5 of 96 in DSA

The rest of this lesson is part of a plan.

A plan opens every lesson, board, video, lab and paper on chalk. Yearly is $39/year.

See plansAlready a member? Sign in

Or start free: a free account opens lessons 2 and 3 of every track.

In this lesson

  • The problem: a pile of facts that won’t hold still
  • January 1956: the pointer, a card that says where the next one is
  • 1955, Munich: the stack, a pile with one rule
  • The queue: the same trail, a fair rule, and the ring buffer that fixes it

Terms it explains: node, pointer, stack, queue, ring buffer, Singly linked, doubly linked, deque, monotonic deque, 3, 10, ADT, call stack, head/tail, interface vs implementation, LIFO/FIFO, linked list, priority queue, ring / circular buffer, singly / doubly linked.

Review DSA