Constant growth · O(1)
Watch the number of marked operations as input size changes.
Play, pause and follow the Python. Watch values move, memory grow and recursive calls return.
Use Next line to predict what will happen, then check the variables. The note beside each Python implementation explains whether the highlight marks the next line or the line just executed.
Compare how work grows, then separate input storage from extra working memory. Open lesson →
Watch the number of marked operations as input size changes.
Watch the number of marked operations as input size changes.
Watch the number of marked operations as input size changes.
Watch the number of marked operations as input size changes.
Compare a running total with a growing copy of the input.
Trace a search from the first comparison to the returned index. Open lesson →
Check values in order; stop at the first match.
Halve the search interval and follow low, mid and high.
Watch comparisons, swaps and the growing sorted section. Open lesson →
Watch the list change while following the actual Python execution.
Watch the list change while following the actual Python execution.
Watch the list change while following the actual Python execution.
Trace a simple recursive function, then explore branching applications conceptually. Open lesson →
Watch calls build up, reach the base case, then return in reverse order.
Partition around a pivot, sort the smaller problems, then combine their results.
An in-order traversal visits the left subtree, the node, then the right subtree.
The same drawing rule repeats at a smaller scale until depth reaches zero.