Programming
Python Data Structure Explorer — Lists, Dicts, Sets
Structure
Press Create to build the structure with Python (the first time loads the Python runtime, about 10 MB).
Operations
O(1) Amortised constant: the list occasionally grows its storage.
How to use this tool
- 1Choose a structure and its starting value, then press Create.
- 2Click an operation (or type any Python statement using data) and press Run.
- 3Watch the structure update and read the result and time complexity.
- 4Copy the history as a Python script to keep it.
Frequently asked questions
They are the average-case costs documented for CPython (for example list.append is amortised O(1), list.insert(0, x) is O(n), set membership is O(1)).
Yes. Any Python statement or expression that uses the variable data works, and errors such as KeyError or IndexError are shown exactly as Python reports them.
Sets have no positions. The tool shows the order Python happens to iterate in, which depends on the hash values.
No. The tool runs real Python 3.11 (Pyodide, Python compiled to WebAssembly) inside your browser. The first run downloads the runtime (about 10 MB) once per visit; your code never leaves your device.
Related tools
Big-O Complexity Explainer — Time & Space
Compare O(1) to O(n!) with exact step counts, times and a growth chart, and measure the complexity of your own code.
Python Variable Tracker — Track State Changes
Track every Python variable through a run: each value it took, on which line, type changes and a chart for numbers.
Python Line-by-Line Executor — Step Execution
Run Python one line at a time: see the line about to run, output as it is printed, changed variables and line counts.