Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The fastest way to compute a Fibonacci number is to simply look in up on the Internet -- not kidding. There was a coding challenge that I did a couple months back which required the cumulative sum of powers of two and the fibonacci sequence, and I just did that. We can talk about faster, general algorithms but most of the time, we are bounded by resources. For example, for the nth Fibonacci number, n will be bounded by some constant. So why not look it up? It's good for playing with theory though.

Edit: Fibonacci may be a specific example, but I wondered how much wasted computation has been spent on calculating the same problem on the same input.



If you're wondering about wasted computation, consider how much energy is expended when you look up a Fibonacci number on the internet.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: