Array $f$ is used to store the $fib()$ values calculated in order to save repeated calls. Since $n = 0$ and $n = 1$ are special cases we can store $fib(2)$ to $f[0], fib(3)$ to $f[1]$ and so on. The missing code completed would be:
if (f[n - 2] != 0){
return f[n-2];
}
t = fib(n-1) + fib(n-2);
f[n-2] = t;
return t;
In this code, $fib(i)$ will do a recursion only once as once $fib(i)$ is calculated it is stored in array. So, the time complexity for $fib(n)$ would be $\Theta(n)$.
PS: We can also store $fib(n)$ in $f(n)$, the above code just saves $2$ elements' space in the array.