Worst case running time of this algorithm (how to justify)?
问题 I have an algorithm i'm trying to implement. I've been asked to determine a function that describes its worst case running time. As input, it takes an array of some length (lets call it n). Then what it does is as follows: if (n==0){ return 0;} else if(n==1){return A[0];} else{ return f(n-1)+f(n-2) } Sorry if I'm a tad sparse on the implementation details, but in a sense, its rather similar to something like the fibbanoci sequence. I'm thinking the worst case running time of this algorithm is