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 Pairing Stones

Learn
Play
Prove
Lesson 1 of 5

GROWTH SAND TABLE

Increase n and watch the work spread

EVERY PAIR

Each stone is compared with every other stone.

O(n²)
growth model25 work

ONE PASS

Visit each stone once and remember what you saw.

O(n)
growth model5 work

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

Two stones in this field sum to exactly 9. The naive hunt checks every pair. When n doubles, the number of possible pairs grows by about four times. Big O calls this O(n²), or quadratic time.

Your call · An O(n²) pair hunt grows from n = 10 to n = 20. About how much work should you expect?

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