3 ms·
"A lot of problems are classic problems in disguise. You'd be amazed to find out how many problems are just sorting + one traversal: reducing the average wait t
by Animats 11y ago
"A lot of problems are classic problems in disguise. You'd be amazed to find out how many problems are just sorting + one traversal: reducing the average wait time in a queue, convex hull, counting duplicate elements (no extra space), interval scheduling, maximum number of overlapping intervals and a ton more. Can you memorize all of these problems individually? No, but you can ask yourself "how about if I sort my data first, what then?"
Amusingly, that's much of what an SQL query optimizer does. It has tables, indices, sorts, searches, and temporary files available, and automatically constructs an algorithm to do the query.
We need more technology like that, where you ask, and it figures out how.