Skip to content
playdsa
Preferences

Make yourself comfortable.

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

Theme
Advanced settings

Wake of the Array

Learn
Play
Prove
Lesson 1 of 7

Live algorithm trace

Running maximum

Complete execution
1 of 5

Initialize best from the first value, so negative-only inputs also work.

1best = nums[0]
2for each x in nums
3if x > best: best = x
4return best
best = 7

Welcome to the Dune Sea. An array is a row of boxes sitting side-by-side in memory. Each box holds one value.

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