powered by v43.aiAprenda anatomia como um artista
Português
Data structures & algorithms

The algorithm playground

Step through the idea. Build an intuition. Solve the mission.

Try hands-on sorting ↓50 topics · 3 learning levels · 150 quest rounds
0 XP0 mastered
Sorting · Foundation

Bubble sort

Ready. Step through the algorithm and explain each change.

  1. for end = n−1 down to 1
  2. swapped = false
  3. for i = 0 to end−1
  4. if a[i] > a[i+1]: swap; swapped = true
  5. if not swapped: break

Up to 12 integers. Apply input to rebuild the trace and restart this topic’s quest.

Practice playground · Explore before your quiz

Be the bubble-sort algorithm

Only swap adjacent values that are out of order. After a complete left-to-right pass, a largest value reaches the right.

0 swaps · Keyboard: Tab to a bar, Enter to select, then select its neighbour.

Select two neighbouring bars, or drag one onto its neighbour.

Practice freely here. Your quiz stars are earned in the concept quest.

A deliberate practice loop

Don’t just watch it move

  1. 1Before stepping, predict the next comparison, pointer move or state update.
  2. 2Read the explanation and identify the invariant that remains true.
  3. 3Change the input, then solve the concept quest without guessing.
About this pathway

From foundations to advanced patterns

The library covers core DSA techniques with bounded teaching examples. Foundation, Builder and Advanced describe learning progression, rather than a school-class syllabus. Snapshots are stored for playback and are excluded from algorithm-space labels.

Further study: MIT Introduction to Algorithms ↗