Concept
Python
Intermediate
35 min
The Barnes-Hut algorithm: how a tree cuts a galaxy's N² forces to N log N
Afterwards you can explain how a Barnes-Hut tree cuts an N-body force sum from N² to N log N work, and pick the opening angle for the accuracy you need.
Particle simulation
Physics