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 EE-2020 Question Paper With Solutions

LEAVE A REPLY

Please enter your comment!
Please enter your name here