677 views
2 votes
2 votes

Consider the following program:

void A(int n){
    printf("*");
    if(n>1){
        A(n/4);
        A(n/4);
        A(n/4);
        A(n/4);
    }
}

Let $X$ be number of asterisks printed by above function when $n=1024.$ Then the value of $X$ will be ____________


How ans will be $\frac{4^{k+1}-1}{3}$ , where $k=5?$ .

Please log in or register to answer this question.

Related questions

4 votes
4 votes
3 answers
2
2 votes
2 votes
2 answers
4
srestha asked May 12, 2019
1,105 views
Consider the following function $foo()$void foo(int n){ if(n<=0) printf("Bye"); else{ printf("Hi"); foo(n-3); printf("Hi"); foo(n-1); } }Let $P(n)$ represent recurrence r...