Computer Sciences > Gate 2020 > function
Consider the following C functions.

int fun1(int n)
{
    static int i= 0;
    if (n > 0) {
      ++i;
      fun1(n-1);
    }
    return (i);
}

int fun2(int n) {
    static int i= 0;
    if (n>0) {
      i = i+ fun1 (n) ;
      fun2(n-1) ;
    }
    return (i);
}

The return value of fun2(5) is ________ .

Explanation

Correct : 55

Similar Questions

What is the worst-case time complexity of insertion in an AVL tree?
Question #23 Medium
Which operations on a binary search tree have O(h) complexity?
Question #31 Easy
Compare search complexities of sorted array vs balanced BST.
Question #47 Hard

Related Topics

Data Structures Binary Search Tree Time Complexity Algorithm Analysis Tree Algorithms Computer Science