下列递归程序能得到正确的斐波那契数,其时间复杂度和空间复杂度都是 O(n)O(n)O(n)。
int fib(int n) { if (n <= 1) return n; return fib(n - 1) + fib(n - 2); }
正确 √
错误 ×