Time Complexity of Fibonacci Series
问题 long int F(int n){ long int F[n]; if (n<2) return n; else { F[0]=0; F[1]=1; for (int i=2; i<n+1; i++) F[i]=F[i-1]+F[i-2]; return F[n]; } } Hi guys, can anyone know how to compute the time complexity of the function above? I am studying C++ and I am quite suffering about compute time complexity of a random algorithm. Please help me! Thanks in advance. 回答1: The code shown relies on a g++ language extension, variable length arrays. I.e. it's not standard C++. The code also misdirects a little by