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 Growth Gallery

Learn
Play
Prove
Lesson 1 of 4

DESERT ROUTE TEST

What happens when the array grows?

DIRECT ADDRESS JUMP

Go straight to the requested index

O(1)
work required1 calculation

FULL SCAN

Check each box in the worst case

O(n)
work required5 checks

O(1) stays flat: the input can grow, but the work does not.

O(n) grows with n: twice as many boxes can mean twice as much work.

O(1) is constant time. The algorithm performs a fixed amount of work even when n becomes enormous. Array indexing is a direct jump.

Your call · What happens to an O(1) lookup when n grows by 1,000 times?

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