info@avatto.com
+91-9920808017
0. Consider the following C functions: int f l(int n) { if(n = = 0 || n = = 1) return n; else return (2* f1( n –1) + 3 * f1(n – 2)); } intf2 (int n) { int i; int X[N], Y[N], Z[N]; X[1] = 1; Y[1] = 2;Z[1] = 3; for( i = 2; i < = n ; i ++ ) { X[i]=Y[i-l] + Z[i-2]; Y[i]=2*X[i]; Z[i] = 3*X[i]; } return X[n] ; } The running time of f1(n) and f2(n) are
Θ(n) and Θ(n)
Θ(2n) and Θ(n)
Θ(n) and Θ(2n)
Θ(2n) and Θ(2n)
You must be logged in to post a 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
You must be logged in to post a comment.