ExamVeda
Login
Home
61
What is co-ordinate compression?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
62
What is the time complexity of the following recursive implementation of linear search?
#include<stdio.h>
int recursive_search_num(int *arr, int num, int idx, int len)
{
     if(idx == len)
     return -1;
     if(arr[idx] == num)
     return idx;
     return recursive_search_num(arr, num, idx+1, len);
}
int main()
{
      int arr[8] ={1,2,3,3,3,5,6,7},num=5,len = 8;
      int indx = recursive_search_num(arr,num,0,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
63
What is the result of the recurrences which fall under third case of Master's theorem (let the recurrence be given by T(n)=aT(n/b)+f(n) and f(n)=nc?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
64
What is the time complexity of the following recursive implementation used to find the sum of the first n natural numbers?
#include<stdio.h>
int recursive_sum(int n)
{
      if(n == 0)
        return 0;
      return n + recursive_sum(n - 1);
}
int main()
{
     int n = 5;
     int ans = recursive_sum(n);
     printf("%d",ans);
     return 0;
}
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
65
Which among the following is the worst case time complexity for deleting an element in coalesced hashing?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
66
Minimum number of unique colors required for vertex coloring of a graph is called?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
67
Consider the following iterative implementation to find the sum of digits of a number:
#include<stdio.h>
int sum_of_digits(int n)
{
      int sm = 0;
      while(n != 0)
      {
          _________;
          n /= 10;
      }
      return sm;
}
int main()
{
      int n = 1234;
      int ans = sum_of_digits(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
68
In the random page replacement algorithm, if the current page doesn't exist in the frame then it is replaced with which of the following page?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
69
When a free man proposes to an available woman, which of the following happens?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
70
Consider the following iterative implementation to find the length of the string:
#include<stdio.h>
int get_len(char *s)
{
      int len = 0;
      while(________)
        len++;
      return len;
}
int main()
{
      char *s = "harsh";
      int len = get_len(s);
      printf("%d",len);
      return 0;
}
Which of the following lines should be inserted to complete the above code?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board