ExamVeda
Login
Home
91
Which of the following don't use matrices?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
92
How many swaps are required for reversing an array having n elements where n is an odd number?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
93
What is the space complexity of the code that uses merge sort for determining the number of inversions in an array?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
94
What will be the auxiliary space complexity of the code to rotate an array by using the reversal algorithm (d = number of rotations)?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
95
What is the time complexity of the code that uses self balancing BST for determining the number of inversions in an array?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
96
Array is divided into two parts in . . . . . . . .
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
97
To search for an element in a sorted array, which searching technique can be used?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
98
What will be the output of the following code?
#include <bits/stdc++.h> 
using namespace std; 
 
void func(int arr[], int n) 
{  
	int count[n]; 
	memset(count, 0, sizeof(count)); 
 
	for (int i=n-2; i>=0; i--) 
	{ 
		if (arr[i] >= n - i - 1) 
			count[i]++; 
 
		for (int j=i+1; j < n-1 && j <= arr[i] + i; j++) 
 
			if (count[j] != -1) 
				count[i] += count[j]; 
 
		if (count[i] == 0) 
			count[i] = -1; 
	} 
 
	for (int i=0; i<n; i++) 
		cout << count[i] << " "; 
} 
 
int main() 
{ 
	int arr[] = {1, 3, 5, 8, 9}; 
	int n = sizeof(arr) / sizeof(arr[0]); 
	func(arr, n); 
	return 0; 
}
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
99
Run-Length encoding is used to compress data in bit arrays.
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
100
In how many different ways we can reach the end of the array arr[]={1,3,5,8,9}?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board