ExamVeda
Login
Home
81
In special case, the time complexity of inserting/deleting elements at the end of dynamic array is . . . . . . . .
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
82
Suffix array can be created by performing . . . . . . . . traversal of a suffix tree.
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
83
If comparison based sorting algorithm is used construct the suffix array, then what will be time required to construct the suffix array?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
84
Which of the following is/are advantages suffix array one suffix tree?
I. Lesser space requirement
II. Improved cache locality
III. Easy construction in linear time
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
85
Which of the following bitwise operations will you use to toggle a particular bit?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
86
What will be the time complexity of the following code?
#include <bits/stdc++.h> 
using namespace std; 
void func(int arr[], int left, int right) 
{ 
    if (left >= right) 
    return; 
 
    int temp = arr[left];  
    arr[left] = arr[right]; 
    arr[right] = temp; 
 
    func(arr, left + 1, right - 1);  
}      
 
void printArray(int arr[], int size) 
{ 
    for (int i = 0; i < size; i++) 
    cout << arr[i] << " "; 
} 
 
int main() 
{ 
	int arr[] = {1,2,3,4}; 
	int n = sizeof(arr) / sizeof(arr[0]); 
	func(arr, 0, n-1); 
	printArray(arr, n); 
	return 0; 
}
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
87
Choose the appropriate code that counts the number of non-zero(non-null) elements in the sparse array.
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
88
Which of the following is a disadvantage of dynamic arrays?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
89
What will be the auxiliary space requirement of the following code?
#include <bits/stdc++.h> 
using namespace std; 
void func(int arr[], int left, int right) 
{     
	while (left < right) 
	{ 
		int temp = arr[left]; 
		arr[left] = arr[right]; 
		arr[right] = temp; 
		left++; 
		right--; 
	} 
 
}	
 
void printArray(int arr[], int size) 
{ 
    for (int i = 0; i < size; i++) 
    cout << arr[i] << " "; 
} 
 
int main() 
{ 
	int arr[] = {1,4,3,5}; 
	int n = sizeof(arr) / sizeof(arr[0]); 
	func(arr, 0, n-1); 
	printArray(arr, n); 
	return 0; 
}
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
90
Which of the following is/are not applications of bit arrays?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board