DSA LabAnimated algorithm lessons, free

Watch the algorithm move.

Not a slideshow: a real algorithm running, one you can pause, scrub and feed your own input, with the code lit line by line beside it.

  • Free to open, no account
  • Type your own array and target
  • Code highlighted as it runs
  • Practice problems after each lesson
  • Runs on your input
  • Scrub to any moment
  • Filed by pattern

01The lessons

Filed by the motion they share.

Once you have seen one halving, you recognise the next. Lessons sit in families, so a pattern you learn once carries to the problems that look different.

01 · 4 lessons

Descend and cull

Binary search’s halving: the window shrinks by half every step, survivors respread.

02 · 2 lessons

Converging walk

Two ends walk toward each other, one retiring per check.

03 · 2 lessons

Running scan

One guide sweeps forward, tracking a running best as it goes.

04 · 3 lessons

In-place partition

A write and a read pointer, bars trading slots instead of a second array.

05 · 1 lesson

Sliding window

Both ends only move forward — expand to grow, shrink while still valid.

02Inside a lesson

Four beats, in the same order every time.

Every lesson follows one structure, so once you have done one you know how all of them work.

  • 01

    The problem first

    What the job is, the obvious way to do it, and what that costs. You see why a technique exists before it appears.

  • 02

    Watch it run

    The algorithm animates on real values with the matching line of code lit, and the live variables beside it.

  • 03

    Scrub and replay

    Drag the timeline to any moment and see a real in-between frame, not the next slide. Change the speed or step a beat at a time.

  • 04

    Try your own input

    Edit the array or the target and the whole run is recomputed on your numbers.

03After the animation

Seeing it is half. Recognising it is the other half.

A lesson does not stop when the animation does. It teaches you to find the pattern in a problem you have never seen.

How to spot it

The signals to look for in a problem statement, and the lookalikes that are not a match.

Why it wins

The cost of the technique set against the obvious way, in numbers you just watched.

Where it goes wrong

The off-by-one and the edge cases that actually cost people time.

Practice

Six problems for the pattern. Tick them off or schedule them into your plan.

Study plannerCheatsheetsTopics

04Real numbers

Complexity, counted rather than claimed.

The Algorithms topic backs its claims with counts from real runs. Here are two of them.

  • Line chart of operation counts for O(1), O(log n), O(n), O(n log n) and O(n squared) for n from 1 to 50.

    What “complexity” means in real operation counts, for n = 1 to 50 on a log scale.

    Algorithms topic
  • Bar chart of comparison counts for four sorting algorithms on the same 200 integers.

    The same 200 integers through four sorts: 19,900 comparisons for bubble sort, 1,286 for merge sort.

    Algorithms topic

05With the assistant

Stuck on a step? Ask.

Watching is free. When you sign in, the assistant is there while you work through a lesson.

AI
  • 01

    Ask while you watch

    The assistant sits at the edge of every page in the app. Ask why a pointer moved, or what a technique costs, without leaving the lesson.

  • 02

    Ask out loud

    Speak the question where the browser supports speech input.

  • 03

    Practice goes into your plan

    Ask it to put a lesson’s practice problems on your study days. It shows the change first; nothing is applied until you confirm.

AI features need a free account. Public pages are read-only.

?Questions

Before you start

Is the DSA Lab free?
Yes. Every lesson is free to open and needs no account.
How is this different from a video?
A video is a recording. In a lesson the algorithm is running, so you can drag the timeline to any moment, change the speed, and type your own array and target to see it play out on your numbers.
Do I need to know the algorithm already?
No. Each lesson starts with the problem and the obvious slow way to solve it, so you know why the technique exists before you watch it work.
How do I know which technique a problem wants?
Every lesson has a “how to spot it” section: the signals to look for in a problem statement, and the cases that look like a match but are not.
Is there practice?
Yes. Lessons end with a set of practice problems linked to the real problems on other sites. You can tick them off or put them on a study date, and they land in your plan.

Press play. Then scrub.

12 lessons are open now, each one free to run on your own input.