# Selection Sort Visualized **Track:** Objects, Data Structures & Algorithms — Creative Coding — the existing 50 **Framework / surface:** p5.js **Level:** Intermediate **Prerequisites:** Arrays, Loops **In one line:** Find the smallest, place it, repeat — sorting made visible. ## Theory, aesthetics & inspiration Selection sort proceeds by a simple, legible discipline: scan the unsorted region for the smallest element, swap it into place, and repeat, growing a sorted prefix one item at a time. Its quadratic cost makes it slow at scale, yet its transparency makes it ideal to watch. The algorithm-visualization tradition—Timo Bingmann's "The Sound of Sorting," which maps array values to pitch, and Steven Halim's VisuAlgo—turns this repetition into image and sound, revealing the comparisons as motion. The aesthetic principle is that an algorithm has a visible rhythm; making the invisible state of computation perceptible is itself a form of explanation.