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 Tri-Sun Trial

Learn
Play
Prove
Lesson 1 of 4

Learn: 3Sum

GROWTH SAND TABLE

Increase n and watch the work spread

THREE NESTED CHOICES

Try every possible first, second, and third value.

O(n³)
growth model125 work

ANCHOR + SENTINELS

Choose one anchor, then sweep the rest once.

O(n²)
growth model25 work

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

Three suns must balance at the horizon. Brute force tries every choice for the first, second, and third value. That is O(n³), or cubic time. Doubling n can multiply the work by eight.

Your call · If an O(n³) search doubles from n = 10 to n = 20, about how much can the 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