Learn it by watching it run
Python visualizers, one topic at a time
Each page explains one idea that is hard to picture, then runs a small example of it in PyVisualizer, so you can step through it line by line and see every value change.
Open PyVisualizer
Your own codeData structures and recursionFreeNo signup
- RecursionPython recursion visualizerWatch a recursive Python function call itself, wait, and hand each return value back up the call stack, one step at a time.
- Linked listsPython linked list visualizerInsert into a linked list and reverse one, and watch every node and next pointer change as the Python code runs.
- Breadth-first searchPython BFS visualizerFollow breadth-first search through a graph in Python: which node leaves the queue, which neighbours join it, and why the first visit is the shortest path.
- ReferencesPython references, explainedWhy changing b changed a: see two Python variables point to the same list, what a copy is, and how [[0] * 3] * 3 shares one row.
- Binary treesPython binary tree visualizerWalk a binary tree in Python and watch each node being visited: an inorder traversal, and the maximum depth worked out by recursion.
- MatricesPython matrix visualizerSee a Python list of lists as the grid it is: walk a matrix in spiral order and rotate it in place, with every row and column index drawn.