ExamVeda
Login
Home
51
. . . . . . . . is a family of combinatorial optimization problems in which a graph is partitioned into two or more parts with constraints.
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
52
Which of the following graphs don't have chromatin number less than or equal to 2?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
53
Fractional knapsack problem can be solved in time O(n).
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
54
Which of the following best represents the time complexity to access an item in the least recently used cache?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
55
What will be the worst case time complexity of finding the sum of elements in a given range of (l,r) in an array of size n when we use square root optimization?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
56
Function rand() generates unique random numbers every time.
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
57
What will be output for the given code?
#include<bits/stdc++.h> 
using namespace std; 
string encrypter(string keyword) 
{ 
	string encoded = ""; 	
	bool arr[26] = {0}; 
	for (int i=0; i<keyword.size(); i++) 
	{ 
		if(keyword[i] >= 'A' && keyword[i] <= 'Z') 
		{ 		
			if (arr[keyword[i]-65] == 0) 
			{ 
				encoded += keyword[i]; 
				arr[keyword[i]-65] = 1; 
			} 
		} 
		else if (keyword[i] >= 'a' && keyword[i] <= 'z') 
		{ 
			if (arr[keyword[i]-97] == 0) 
			{ 
				encoded += keyword[i] - 32; 
				alpha[keyword[i]-97] = 1; 
			} 
		} 
	} 
	for (int i=0; i<26; i++) 
	{ 
		if(arr[i] == 0) 
		{ 
			arr[i]=1; 
			encoded += char(i + 65); 
		} 
	} 
	return encoded; 
} 
string ciphertxt(string msg, string encoded) 
{ 
	string cipher=""; 
	for (int i=0; i<msg.size(); i++) 
	{ 
		if (msg[i] >='a' && msg[i] <='z') 
		{ 
			int pos = msg[i] - 97; 
			cipher += encoded[pos]; 
		} 
		else if (msg[i] >='A' && msg[i] <='Z') 
		{ 
			int pos = msg[i] - 65; 
			cipher += encoded[pos]; 
		} 
		else
		{ 
			cipher += msg[i]; 
		} 
	} 
	return cipher; 
} 
int main() 
{ 
	string keyword; 
	keyword = "cipher"; 	
	string encoded = encrypter(keyword); 
	string message = "hello"; 
	cout  << ciphertxt(message,encoded) << endl; 
	return 0; 
}
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
58
What is the set partition problem?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
59
Find the output of the following code.
#include<math.h> 
#include<iostream.h>
using namespace std;
void distance(float x, float y, float a, float b, float c) 
{ 
	float d = fabs((a * x + b * y + c)) / (sqrt(a * a + b * b)); 
	cout<<d;
	return; 
} 
int main() 
{ 
	float x = -2; 
	float y = -3; 
	float a = 5; 
	float b = -2; 
	float c = - 4; 
	distance(x, y, a, b, c); 
	return 0; 
}
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
60
What will be the plain text corresponding to cipher text "YGQ" if hill cipher is used with keyword as "GYBNQKURP"?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board