Computer Science Engineering (CSE) Exam  >  Computer Science Engineering (CSE) Tests  >  Test: Algorithms - Computer Science Engineering (CSE) MCQ

Test: Algorithms - Computer Science Engineering (CSE) MCQ


Test Description

10 Questions MCQ Test - Test: Algorithms

Test: Algorithms for Computer Science Engineering (CSE) 2024 is part of Computer Science Engineering (CSE) preparation. The Test: Algorithms questions and answers have been prepared according to the Computer Science Engineering (CSE) exam syllabus.The Test: Algorithms MCQs are made for Computer Science Engineering (CSE) 2024 Exam. Find important definitions, questions, notes, meanings, examples, exercises, MCQs and online tests for Test: Algorithms below.
Solutions of Test: Algorithms questions in English are available as part of our course for Computer Science Engineering (CSE) & Test: Algorithms solutions in Hindi for Computer Science Engineering (CSE) course. Download more important topics, notes, lectures and mock test series for Computer Science Engineering (CSE) Exam by signing up for free. Attempt Test: Algorithms | 10 questions in 30 minutes | Mock test for Computer Science Engineering (CSE) preparation | Free important questions MCQ to study for Computer Science Engineering (CSE) Exam | Download free PDF with solutions
Test: Algorithms - Question 1

Which of the following standard algorithms is not Dynamic Programming based.

Detailed Solution for Test: Algorithms - Question 1

Prim’s Minimum Spanning Tree is a Greedy Algorithm. All other are dynamic programming based.

Test: Algorithms - Question 2

Which of the following is not O(n^2)?

Detailed Solution for Test: Algorithms - Question 2

The order of growth of option c is n2.5 which is higher than n2.

1 Crore+ students have signed up on EduRev. Have you? Download the App
Test: Algorithms - Question 3

Consider the following C program

int main() 

   int x, y, m, n; 

   scanf ("%d %d", &x, &y); 

   /* x > 0 and y > 0 */

   m = x; n = y; 

   while (m != n) 

   { 

      if(m>n) 

         m = m - n; 

      else

         n = n - m; 

   } 

   printf("%d", n); 

}

What does the program compute?

Detailed Solution for Test: Algorithms - Question 3

This is an implementation of Euclid’s algorithm to find GCD

Test: Algorithms - Question 4

What is the time complexity of Floyd–Warshall algorithm to calculate all pair shortest path in a graph with n vertices?

Detailed Solution for Test: Algorithms - Question 4

Floyd–Warshall algorithm uses three nested loops to calculate all pair shortest path. So, time complexity is θ(n^3).

Test: Algorithms - Question 5

Consider two strings A = “qpqrr” and B = “pqprqrp”. Let x be the length of the longest common subsequence (not necessarily contiguous) between A and B and let y be the number of such longest common subsequences between A and B. Then x + 10y = ___.

Detailed Solution for Test: Algorithms - Question 5

//The LCS is of length 4. There are 3 LCS of length 4 “qprr”, “pqrr” and qpqr

A subsequence is a sequence that can be derived from another sequence by selecting zero or more elements from it, without changing the order of the remaining elements.
Subsequence need not be contiguous.
Since the length of given strings A = “qpqrr” and B = “pqprqrp” are very small, we don’t need to build a 5×7 matrix and solve it using dynamic programming.
Rather we can solve it manually just by brute force.
We will first check whether there exist a subsequence  of length 5 since min_length(A,B) = 5.

Since there is no subsequence , we will now check for length 4. “qprr”, “pqrr” and “qpqr” are common in both strings.

X = 4 and Y = 3

X + 10Y = 34

Test: Algorithms - Question 6

Let SHAM3 be the problem of finding a Hamiltonian cycle in a graph G = (V,E) with V divisible by 3 and DHAM3 be the problem of determining if a Hamiltonian cycle exists in such graphs. Which one of the following is true?

Detailed Solution for Test: Algorithms - Question 6

The problem of finding whether there exist a Hamiltonian Cycle or not is NP Hard and NP Complete Both.

Finding a Hamiltonian cycle in a graph G = (V,E) with V divisible by 3 is also NP Hard.

Test: Algorithms - Question 7

Consider the following two problems of graph.
1. Given a graph, find if the graph has a cycle that visits every vertex exactly once except the first visited vertex which must be visited again to complete the cycle.
2. Given a graph, find if the graph has a cycle that visits every edge exactly once.
Which of the following is true about above two problems.

Detailed Solution for Test: Algorithms - Question 7

Problem 1 is Hamiltonian Cycle problem which is a famous NP Complete problem.

Problem 2 is Euler Circuit problem which is solvable in Polynomial time.

Test: Algorithms - Question 8

If we use Radix Sort to sort n integers in the range (nk/2,nk], for some k>0 which is independent of n, the time taken would be?

Detailed Solution for Test: Algorithms - Question 8

Radix sort time complexity = O(wn)
for n keys of word size= w
=>w = log(nk)
O(wn)=O(klogn.n)
=> kO(nlogn)

Test: Algorithms - Question 9

Which of the following is not a backtracking algorithm?

Detailed Solution for Test: Algorithms - Question 9

Knight tour problem, N Queen problem and M coloring problem involve backtracking. Tower of hanoi uses simple recursion.

Test: Algorithms - Question 10

A system wherein items are added from one and removed from the other end.

Detailed Solution for Test: Algorithms - Question 10

 In a queue, the items are inserted from the rear end and deleted from the front end.

Information about Test: Algorithms Page
In this test you can find the Exam questions for Test: Algorithms solved & explained in the simplest way possible. Besides giving Questions and answers for Test: Algorithms, EduRev gives you an ample number of Online tests for practice

Top Courses for Computer Science Engineering (CSE)

Download as PDF

Top Courses for Computer Science Engineering (CSE)