Vidyalelo
Data Structure · all questions

Miscellaneous on Data Structures
practice.

Practice every MCQ with options. Use Show answers when you want the correct option and solution.

1,171

Questions

59/59

Page

Pick an option on a question to see the right answer and solution.

What will be the output of the following C++ code?
#include <cmath> 
#include <iostream> 
using namespace std; 
void Cipher(string str) 
{ 
    int r, c; 
    for (int i = 0; str[i]; i++) 
    { 
 
	r = ceil((str[i] - 'a') / 5) + 1; 
 
 
	c = ((str[i] - 'a') % 5) + 1; 
 
 
	if (str[i] == 'k') 
        { 
	    r = r - 1; 
	    c = 5 - c + 1; 
	} 
 
 
	else if (str[i] >= 'j') 
        { 
	    if (c == 1) 
            { 
		c = 6; 
		r = r - 1; 
	    } 
	    c = c - 1; 
	} 
	cout << r << c; 
    } 
    cout << endl; 
} 
 
int main() 
{ 
    string str = "nsit"; 
    Cipher(str); 
}

Select an option to see the answer and solution.

Which of the following is similar to Euclidean distance?

Select an option to see the answer and solution.

What is the space complexity of floyd's cycle finding algorithm?

Select an option to see the answer and solution.

What will be the cut vertex set of the graph given below?
Miscellaneous on Data Structures mcq question image

Select an option to see the answer and solution.

What is the LCM of two coprime numbers?

Select an option to see the answer and solution.

Floyd's cycle detection algorithm is also called the 'tortoise and hare algorithm'.

Select an option to see the answer and solution.

Which of the following algorithms is the simplest?

Select an option to see the answer and solution.

How many Hamiltonian paths does the following graph have?
Miscellaneous on Data Structures mcq question image

Select an option to see the answer and solution.

How many conditions have to be met if an NP- complete problem is polynomially reducible?

Select an option to see the answer and solution.

Which of the following problems is similar to that of a Hamiltonian path problem?

Select an option to see the answer and solution.

Which of the following is a type of transposition cipher?

Select an option to see the answer and solution.