ExamVeda
Login
Home
31
Recursive solution of Set partition problem is faster than dynamic problem solution in terms of time complexity.
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
32
What is the output of the following code?
#include<stdio.h>
int recursive_sum_of_digits(int n)
{
      if(n == 0)
        return 0;
      return n % 10 + recursive_sum_of_digits(n/10);
}
int main()
{
      int n = 1234321;
      int ans = recursive_sum_of_digits(n);
      printf("%d",ans);
      return 0;
}
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
33
Consider the following iterative implementation to find the factorial of a number. Which of the lines should be inserted to complete the below code?
int main()
{
    int n = 6, i;
    int fact = 1;
    for(i=1;i<=n;i++)
      _________;
    printf("%d",fact);
    return 0;
}
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
34
What is the basic operation of closest pair algorithm using brute force technique?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
35
Which of the following is not a type of transposition cipher?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
36
The running time of implementing naive solution to min-cut problem is?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
37
Which of the following is not a poly alphabetic substitution cipher?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
38
What is the result of the recurrences which fall under first 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 A
No explanation is given for this question. Let's Discuss on Board
39
What will be the encrypted text corresponding to plain text "CLASSIFIED" using columnar transposition cipher with a keyword as "GAMES"?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
40
What will be the output for the following code?
#include <stdio.h> 
void combination(int arr[], int aux[], int start, int end, int index, int r); 
void print(int arr[], int n, int r) 
{ 	
	int aux[r]; 
        combination(arr, aux, 0, n-1, 0, r); 
}
void combination(int arr[], int aux[], int start, int end, int index, int r) 
{ 	
	if (index == r) 
	{ 
		for (int j=0; j<r; j++) 
			printf("%d ", aux[j]); 
		printf(", "); 
		return; 
	} 	
	for (int i=start; i<=end && end-i+1 >= r-index; i++) 
	{   aux[index] = arr[i]; 
		combination(arr, aux, i+1, end, index+1, r); 
	} 
}  
int main() 
{ 
	int arr[] = {1, 2, 3}; 
	int r = 2; 
	int n = sizeof(arr)/sizeof(arr[0]); 
	print(arr, n, r); 
}
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board