Gate CS-2004 Question Paper With Solutions

Q. 9 The time complexity of the following C function is (assume n > 0)

int recursive(int n) {

if (n==1)

return(1);

else

return(recursive(n-1)+recursive(n-1);

}

Gate CS-2004 Question Paper With Solutions

Answer: (D)

Explanation:

Gate CS-2004 Question Paper With Solutions

Gate CS-2004 Question Paper With Solutions

Learn More:   Gate CS-2015-2 Question Paper With Solutions

LEAVE A REPLY

Please enter your comment!
Please enter your name here