My Report

Data Structure II Mock Test 10


Correct Answer: 2 points | Wrong: -1 point
Grades: A* (100% score) | A (80%-99%) | B (60%-80%) | C (40%-60%) | D (0%-40%)
advertisement
 10%

Question 1 of 10

1. Which of the following is an alternative name of the quickselect algorithm?

Question 1 of 10

Question 2 of 10

2. The letters of a word are separated by a space of how many durations?

Question 2 of 10

Question 3 of 10

3. An Extended hamming code is also called as __________

Question 3 of 10

Question 4 of 10

4. When the topological sort of a graph is unique?

Question 4 of 10

Question 5 of 10

5. In Morse Code, each dot or dash within a character is followed by a period of signal absence. What is the name of that signal?

Question 5 of 10

Question 6 of 10

6. Problems that cannot be solved by any algorithm are called?

Question 6 of 10

Question 7 of 10

7. How many stages of procedure does a non-deterministic algorithm consist of?

Question 7 of 10

Question 8 of 10

8. Morse Code is named after which scientist?

Question 8 of 10

Question 9 of 10

9. What will be the auxiliary space complexity of the following code?

#include <bits/stdc++.h> 
using namespace std; 
void convert(int arr[], int n) 
{ 	
	int temp[n]; 
	memcpy(temp, arr, n*sizeof(int)); 
	sort(temp, temp + n); 	
        unordered_map<int, int> map; 	
	int sort_index = 0; 
	for (int i = 0; i < n; i++) 
		map[temp[i]] = sort_index++; 	
	for (int i = 0; i < n; i++) 
		arr[i] = map[arr[i]]; 
} 
void printArr(int arr[], int n) 
{ 
	for (int i=0; i<n; i++) 
		cout << arr[i] << " "; 
} 
int main() 
{ 
	int arr[] = {10, 20, 15, 12, 11, 50}; 
	int n = sizeof(arr)/sizeof(arr[0]); 
	convert(arr , n); 	
	printArr(arr, n); 
	return 0; 
} 

Question 9 of 10

Question 10 of 10

10. Recursive solution of subset sum problem is faster than dynamic problem solution in terms of time complexity.

Question 10 of 10


 

Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.