edited by
17,793 views
60 votes
60 votes

Consider the following recursive C function.

void get(int n)
{
    if (n<1) return;
    get (n-1);
    get (n-3);
    printf("%d", n);
}

If $get(6)$ function is being called in $main()$ then how many times will the $get()$ function be invoked before returning to the $main()$?

  1. $15$
  2. $25$
  3. $35$
  4. $45$
edited by

5 Answers

Answer:

Related questions

67 votes
67 votes
11 answers
2
go_editor asked Feb 15, 2015
17,274 views
Let $f(n) = n$ and $g(n) = n^{(1 + \sin \: n)}$, where $n$ is a positive integer. Which of the following statements is/are correct?$f(n) = O(g(n))$$f(n) = \Omega(g(n))$On...
57 votes
57 votes
5 answers
3
44 votes
44 votes
5 answers
4
go_editor asked Feb 15, 2015
10,743 views
Let $G$ be a connected undirected graph of $100$ vertices and $300$ edges. The weight of a minimum spanning tree of $G$ is $500$. When the weight of each edge of $G$ is i...