Skip to content
playdsa
Preferences

Make yourself comfortable.

Saved on this browser. Your device’s reduced-motion preference is always respected.

Theme
Advanced settings

The Nested Mirage

Learn
Play
Prove
Lesson 1 of 4

GROWTH SAND TABLE

Increase n and watch the work spread

ONE LOOP

One pass across n values.

O(n)
growth model5 work

TWO NESTED LOOPS

Up to n steps for each of n steps.

O(n²)
growth model25 work

Big O focuses on the shape of growth. Constants and small details matter less once n becomes large.

A loop inside a loop often creates O(n²) work. For every one of n outer steps, the inner loop can perform n more steps.

Your call · If n doubles, about how much can O(n²) work grow?

Help shape PlayDSA

Something confusing, broken, or missing? Leave a quick note without leaving your lesson.

Please leave out passwords, payment details and other private information.

Page included: /

Sign in to save feedback here, or send it with your email app. Your draft stays here while you sign in.

Open email instead