What are the two factors which contribute to the inefficiency of some recursive solutions?
What will be an ideal response?
The two factors are the overhead associated with method calls, and the inherent inefficiency of some recursive algorithms.
Computer Science & Information Technology
You might also like to view...
Which browser has stopped using favicons?
a. Internet Explorer b. Firefox c. Safari d. iOS
Computer Science & Information Technology
What is the output of the following code fragment?
int f1(int n, int m) { if(n < m) return 0; else if(n==m) return m+ f1(n-1,m); else return n+ f1(n-2,m-1); } int main() { cout << f1(5,4); return 0; } a. 0 b. 2 c. 4 d. 8 e. infinite recursion
Computer Science & Information Technology