Algorithm dossier
- Category: Sort
- Worst-case complexity: O(n)
- Approach: Iterative
- Data structure: Array
- First formalised: 1950s
Why this snippet is Radix Sort
Why radix sort. Sorts by digit, least-significant first. The outer loop multiplies the divisor e by 10 each pass; the inner work partitions into 10 buckets keyed by (x / e) % 10, then concatenates the buckets back. The tell. The base-10 bucket array and the e *= 10 advance are diagnostic — counting sort would build *one* count array sized to the whole range, not 10 per pass.
How to read a redacted algorithm
Algodle strips identifier names so the snippet has to be read for its shape: the control flow, the data structures it manipulates, the order in which it visits its input. Loops with two pointers crawling toward each other are usually search or partition. A recursion that splits its input in half and recurses on both halves is divide-and-conquer. A priority queue plus graph traversal is almost certainly Dijkstra, Prim, or A*. Six hint columns — category, complexity, approach, data structure, era — let you triangulate even when the snippet itself is opaque.