ExamVeda
Login
Home
71
What is the time complexity of the following recursive implementation used to find the length of the string?
#include<stdio.h>
int recursive_get_len(char *s, int len)
{
      if(s[len] == 0)
        return 0;
      return 1 + recursive_get_len(s, len+1);
}
int main()
{
      char *s = "abcdef";
      int len = recursive_get_len(s,0);
      printf("%d",len);
      return 0;
}
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
72
Strassen's algorithm is a/an. . . . . . . . algorithm.
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
73
Consider the following recursive implementation to find the factorial of a number. Which of the lines should be inserted to complete the below code?
int fact(int n)
{
     if(_________)
        return 1;
     return n * fact(n - 1);
}
int main()
{
      int n = 5;
      int ans = fact(n);
      printf("%d",ans);
      return 0;
}
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
74
What is the time complexity of the following code used to search an element in an array?
#include<stdio.h>
int search_num(int *arr, int num, int len)
{
     int i;
     for(i = 0; i < len; i++)
     if(arr[i] == num)
        return i;
     return -1;
}
int main()
{
      int arr[5] ={1,3,3,3,5},num=3,len = 5;
      int indx = search_num(arr,num,len);
      printf("Index of %d is %d",num,indx);
      return 0;
}
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
75
In which year the symbol @ was added to the official Morse character set by ITU-R?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
76
What will be the chromatic index of the following graph?
Miscellaneous on Data Structures mcq question image
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
77
What is the auxiliary space requirement of the quickselect algorithm?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
78
Are trees bipartite?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
79
Bellmann Ford Algorithm is an example for . . . . . . . .
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
80
By using which of the following data structure, the hash sequence is implemented within the hash table in coalesced hashing?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board