Assuming arithmetic operations are O(1) (which is not true when dealing with big-integers). There are at least 5 methods I know.
1. naive recursion, O(k^n) time and O(n) space.
2. memoizied recursion, O(n) time and space.
3. loop with 3 variables. O(n) time, O(1) space.
4. matrix multiplication, O(log n) time , O(1) space.
5. Binet's formula without rounding error. (complexity is not trivial to analyze)
Code4Food2020-04-09 10:27:55
For matrix multiplication, there is an optimization to use only half of the matrix but that optimization does not change the overall time complexity.
2 & 3 are different. 2 is usually top-down where as 3 is bottom-up.
To use Binet's formula without rounding errors, one needs to deal with rational number arithmetics. That requires adding fractions, which requires computing GCD and division. I don't have a good estimate for the time complexity.