3 ms·
It matters sometimes. A while back, I wrote a program to solve a puzzle. The more complex the puzzle, the longer it took to solve. Today, I might come up wit
by wccrawford 16y ago
It matters sometimes.
A while back, I wrote a program to solve a puzzle. The more complex the puzzle, the longer it took to solve. Today, I might come up with a better algorithm, but back then, all I could find was a brute-force approach. The most complex puzzle I had seen at the time was taking hours to run.
The program was written in VB6, and it was just wasn't mean for CPU-intensive programs like that. If I were to write that program again today, I'd be looking at optimizing the code for speed, starting with the language.
So yes, the question -does- matter. Sometimes.
- angusgr 16y agoToday, I might come up with a better algorithm, but back then, all I could find was a brute-force approach. The most complex puzzle I had seen at the time was taking hours to run. I bet that you could come up with a better algorithm now, even in VB6 if you had to, to get the run time down. I've seen people take "optimised" C solutions that run in hours and make them run in minutes, just by rewriting the algorithm and rethinking basic assumptions.