Skip to content

Academy · Data structures and algorithms

Learn an algorithm by tracing what it does.

Start with a small example, predict each step, and test where your reasoning breaks. Apex Academy has guided DSA practice and visual models for exploring the underlying structures.

Personal planning requires sign-in. Academy offers a separate learning route.

Try a Two Sum trace

Given [2, 7, 11, 15] and a target of 9, find two different positions whose values add to the target.

  1. At the first value, 2, the missing complement is 7. Remember that 2 appeared at index 0.
  2. At the next value, 7, the missing complement is 2. The remembered index is 0, so the pair is indices 0 and 1.

Before coding, try [3, 3] with target 6. A value can repeat, but the two positions must still be different. Checking the remembered complement before storing the current position makes that distinction clear.

Continue with the interactive problem catalog

A practice loop you can reuse

Predict

Write down what the next operation should do before running the example.

Test an edge case

Change one input, such as a repeated value or an empty collection, and check your prediction.

Explain the rule

Describe why the approach works and when its assumptions would fail.

Move from the example to the structure

The same questions carry into arrays, linked lists, trees, and graphs: what state do you keep, what changes at each step, and what invariant remains true? Use the Academy catalog to choose a problem and its available explanation or visual model. This page is a preview; practice and progress happen in Academy.

Choose one problem and trace it.

Open the DSA catalog, then work through an example before writing code.

Open DSA in Academy