info@avatto.com
+91-9920808017
0. Consider the following C function: double foo(int n) { int i; double sum; if (n = = 0) return 1.0; else { sum = 0.0; for (i = 0; i < n ; i ++) sum + = foo(i); return sum; } } The space complexity of the above function is foo() and store the values of foo(i), 0 < = i < n, as and when they are computed. With this modification, the time complexity for function foo() is significantly reduced. The space complexity of the modified function would be
O(1)
O(n)
O(n2)
O(n!)
Your email address will not be published. Required fields are marked *
Report
Name
Email
Website
Save my name, email, and website in this browser for the next time I comment.
Comment
Login with Facebook
Login with Google
Forgot your password?
Lost your password? Please enter your email address. You will receive mail with link to set new password.
Back to login