3 ms·
Most code converts an array of items into another array of items (Ex: Sorting converts an arbitrary array into a sorted array). If you're a more complicated fe
by dragontamer 7y ago
Most code converts an array of items into another array of items (Ex: Sorting converts an arbitrary array into a sorted array).
If you're a more complicated fellow, you'll convert a tree of items into another tree of items. For example, collision detection in video games is often done with B-Trees, Raytracing with BVH trees that represent all the vertices on the screen.
The final step... the end-all be-all of complexity... is the arbitrary graph. That is: code that walks arbitrary graphs, and converts them into other arbitrary graphs. After all, most code have cycles, so you can't even make a DAG-assumption like in maximum flow.
That's about it. We may call it "dead code elimination", or "common subexpression elimination". But at the end of the day, all you're doing is running graph-analysis, and then converting that graph into a "more efficient" form.
- haecceity 7y agoInteresting perspective! Even graph analysis could be reduced to manipulating infinite tape in the end.