A WORKBENCH FOR YOUR IDEAS
Algorithms you can see.
Write Python. Run a trace. Follow each change, then test the edges.
Begin with a starter or inspect a worked answer. Your code runs in this browser.
Play, pause and scrub through real Python state after each line.
Tests cover normal inputs, empty cases, ties and other traps. Progress stays on this device.
Basics
Data structures
Algorithms
Topological Sort
Release tasks as their final prerequisite is removed
Open lab PYTHON · RUNS HERE0/1 Knapsack
Fill a capacity table without taking an item twice
Open lab PYTHON · RUNS HEREBellman–Ford
Relax weighted edges and detect reachable negative cycles
Open lab PYTHON · RUNS HEREEdit Distance Rows
Compare prefixes with insertion, deletion and substitution
Open labMachine learning
Linear Regression
Move a fitted line by following the mean squared-error gradient
Open lab PYTHON · RUNS HERELogistic Regression
Turn a score into a probability and learn a binary boundary
Open lab PYTHON · RUNS HERENearest Neighbours
Rank points by distance, then vote with explicit tie rules
Open lab PYTHON · RUNS HEREDecision Stumps
Try thresholds and choose the lowest weighted Gini impurity
Open lab