ExamVeda
Login
Home
91
What is the output of the following code?
#include<stdio.h>
int arr[31], len = 0;
void recursive_dec_to_bin(int n)
{
      if(n == 0 && len == 0)
      {
          arr[len++] = 0;
          return;
      }
      if(n == 0)
         return;
      arr[len++] = n % 2;
      recursive_dec_to_bin(n/2);
}
int main()
{
     int n = 111,i;
     recursive_dec_to_bin(n);
     for(i=len-1; i>=0; i--)
     printf("%d",arr[i]);
     return 0;
}
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
92
Consider the following recursive implementation to find the nth fibonacci number:
int fibo(int n)
{
     if(n == 1)
        return 0;
     else if(n == 2)
        return 1;
     return ________;
}
int main()
{
     int n = 5;
     int ans = fibo(n);
     printf("%d",ans);
     return 0;
}
Which of the following lines should be inserted to complete the above code?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
93
The concept of cross product is applied in the field of computer graphics.
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
94
Which one of the following is the chromatic number of bipartite graph?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
95
Backtracking algorithm is implemented by constructing a tree of choices called as?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
96
Which of the following is not another name for GCD(Greatest Common Divisor)?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
97
What is the time complexity of the above recursive implementation used to reverse a string?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
98
Autokey cipher is an example of . . . . . . . .
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
99
Coalesced hashing is better than separate chaining.
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
100
In a complete bipartite graph Km, n, the minimum vertex cover is of the size max{m, n}.
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board