Visualization
The base class for every drawable data structure. It provides the shared draw() / drop() lifecycle and a no-op method.
Drawable(—)
Drawable is abstract and is never instantiated directly; only its subclasses are created.
draw()
Marks the object as present in the visualization, producing a frame. Typically called once right after creating the object.
drop()
Marks the object as removed from the visualization, so it no longer appears in subsequent frames.
Code library
Partitions around a pivot, then sorts both sides recursively.
Sorts two halves, then merges them into one ordered list.
Swaps adjacent values until the list is sorted.
Builds a sorted section by inserting one value at a time.
Finds the smallest remaining value and moves it to the front.
Moves forward when values are ordered and backtracks when they are not.
Bubbles values in both directions to narrow the unsorted range.
Counts each value, then writes the values back in order.
Scans left to right until it finds the target or passes where it would be.
Checks the middle of a sorted list and removes half each step.
Splits a sorted list into thirds to find the target.
Jumps through sorted blocks, then scans the matching block.
Finds the outer boundary of a set of 2D points.
Wraps around the outermost points to build a convex hull.
Carves a maze by walking forward and backtracking at dead ends.
Grows a maze evenly by processing rooms in queue order.
Builds a maze by repeatedly dividing open areas with walls.
Builds a maze from random walks with loops removed.
Searches outward in rings and finds the shortest path on an unweighted grid.
Follows one path deeply, then backtracks when it reaches a dead end.
Moves toward the goal using distance as its guide.
Searches from both ends until the two paths meet.
Finds a shortest path by combining distance traveled with a goal estimate.
Runs A* on a larger maze to show the search at scale.
Uses SQLAlchemy to create and query a database.
Uses Python's built-in sqlite3 library to manage data.
Uses DuckDB to query data with SQL.
Simulation of a supply chain and congestion.
Follow packages and data as it travels through a network of routers between computers.
A service cluster grows and shrinks as demand changes.