3 ms·
O(1)? Having all the answers pre-cached would be the only way to do that. Unless there is some kind of quantum computer algorithm that fits this problem well.
by Practicality 10y ago
O(1)? Having all the answers pre-cached would be the only way to do that.
Unless there is some kind of quantum computer algorithm that fits this problem well.
- stephencanon 10y agoThe nth Fibonacci number has O(n) digits, so even reading a cached pre-computed result from memory is O(n).