Design and Analysis of Algorithms
Design and Analysis of Algorithms
1 of 2
|'''|'|'|''|''||'|||
Code No: R2031052 R20 SET - 1
UNIT-IV
7. a) What is sum-of-subsets problem? Write a recursive backtracking [7M]
algorithm for sum of subsets problem.
b) Describe Backtracking technique to m-coloring graph. [7M]
(OR)
8. a) Briefly explain n-queen problem using backtracking. [7M]
b) Describe the algorithm for Hamiltonian cycles and Determine the [7M]
order of magnitude of the worst-case computing time for the
backtracking procedure that finds all Hamiltonian cycles.
UNIT-V
9. a) Explain the P, NP, NP-Hard and NP- complete classes with [7M]
suitable examples.
b) Briefly explain Cooks-theorem. [7M]
(OR)
10. a) Show that the Hamiltonian cycles problem on directed graphs is [7M]
NP-complete.
b) Write about non deterministic algorithms and choice, failure and [7M]
success functions with search example.
2 of 2
|'''|'|'|''|''||'|||
Code No: R2031052
R2031011
R2031051 R20 SET - 2
UNIT-I
1. a) Write an algorithm for Bubble sort and analyze the algorithm for [7M]
its time complexity
complexity.
b) What are the different mathematical notations used for [7M]
algorithm analysis
analysis? Explain them
(OR)
2. a) Write short notes on probabilistic analysis. Discuss its role in [7M]
Algorithemic analysis.
b) Write Randomized algorithm of Quick sortsort. [7M]
UNIT-II
3. a) Using Merge sort, sort the following elements: [7M]
310, 285, 179, 652, 351, 423, 861, 254, 450, 520
b) Explain Defective chess board Problem. [7M]
(OR)
4. a) Apply the greedy method to solve Knapsack problem for given [7M]
instance Where n=3, m=20, (p1,p2,p3)=(25,24,15), and weight
(w1,w2,w3)=(18,15,10).
b) What is the need of greedy method, explain with an example? [7M]
UNIT-III
5. a) Draw an Optimal Binary Search Tree for n=4 identifiers [7M]
(a1,a2,a3,a4)
,a4) = ((do,
do, if, read, while) P(1:4)=(3,3,1,1) and
Q(0:4)=(2,3,1,1,1).
b) Explain Multistage Graphs with example
example. [7M]
(OR)
6. a) Show that reliability design problem finds the best solution with [7M]
multiple stages for the given instance. N=3, (c1,c2,c3)=
(40,15,25), and C=120, (r1,r2,r3)= (0.9,0.8,0.7).
b) Compute All pairs
pairs-shortest path for following graph. [7M]
1 of 2
|'''|'|'|''|''||'|||
Code No: R2031052 R20 SET - 2
UNIT-IV
7. a) Explain the 4-queen problem using backtracking. [7M]
b) Explain how the Euler circuit problem is solved by using the [7M]
backtracking concept.
(OR)
8. a) Explain the major drawbacks of backtracking method with [7M]
example.
b) Write an algorithm for sum of subsets problem. [7M]
UNIT-V
9. a) Explain the classes of NP-Hard and NP-Complete. [7M]
b) Discuss about deterministic and non-deterministic algorithms. [7M]
(OR)
10. a) Give examples of some deterministic algorithms. Justify. [7M]
b) Using an example prove that, satisfiability of boolean formula in [7M]
3-Conjunctive Normal form is NP-Complete.
2 of 2
|'''|'|'|''|''||'|||
Code No: R2031051
R2031011
R2031052 R20 SET - 3
|'''|'|'|''|''||'|||
Code No: R2031052 R20 SET - 3
UNIT-V
9. a) Explain the classes of NP and NP-Complete giving example [7M]
problem for each.
b) Give examples of some non-deterministic algorithms. Justify. [7M]
(OR)
10. a) Explain the strategy to prove that a problem is NP hard. [7M]
b) Give the applications of Cook’s theorem. [7M]
2 of 2
|'''|'|'|''|''||'|||
Code No: R2031052
R2031011
R2031051 R20 SET - 4
UNIT-I
1. a) Explain time complexity of insertion sort in different cases. [7M]
b) Explain the asymptotic notations with an example for each. [7M]
(OR)
2. a) How to measure the performance of an algorithm? Give some [7M]
parameters.
b) Analyze the computing time complexity of binary search [7M]
algorithm.
UNIT-II
3. a) Compare and contrast the general method of greedy and divide [7M]
and conquer approaches.
b) Design an algorithm to sort the given list of elements using [7M]
Quick Sort incorporating divide and conquer technique. Sort the
following list using the same and compute its best case time
efficiency: 4, 2, 0, 8, 7, 1, 3, 6.
(OR)
4. a) Explain the Knapsack problem. Find an optimal solution to the [7M]
Knapsack instance n=7, m=15,
(p1, p2, p3, …p7)=(10,5,15,7,6,18,3) and (w1, w2, w3, …w7)=(2,
3, 5,7, 1, 4, 1).
b) Explain single source shortest path Problem with example. [7M]
UNIT-III
5. a) Solve the following 0/1 Knapsack problem using dynamic [7M]
programming P= (11, 21, 31, 33), W= (2, 11, 22, 15), C=40, n=4.
b) Explain the methodology of Dynamic programming. Mention the [7M]
applications of Dynamic programming.
(OR)
6. a) Discuss the time and space complexity of Dynamic Programming [7M]
traveling sales person algorithm.
b) Compute All pairs-shortest path for following graph. [7M]
1 of 2
|'''|'|'|''|''||'|||
Code No: R2031052 R20 SET - 4
UNIT-IV
7. a) Find a solution to the 8-Queens problem using backtracking [7M]
strategy. Draw the solution space using necessary bounding
function.
b) Find all m-colors of a graph with undirected connections v1->2, [7M]
v1->v3, v1->v4, v2->v3, v2->v4, v2->v5, v3->v4, v4->v5 using
backtracking technique.
(OR)
8. a) Write the algorithm for general iterative backtracking method [7M]
and explain various factors that define the efficiency of
backtracking.
b) Explain the Graph – coloring problem. And draw the state space [7M]
tree for m= 2 colors n=4 vertices graph. Discuss the time and
space complexity.
UNIT-V
9. a) Briefly explain NP-hard and NP-completeness with example. [7M]
b) Explain non deterministic algorithms? Give some examples. [7M]
(OR)
10. a) Is Travelling salesman problem NP-hard or NP-Complete? Justify [7M]
your answer.
b) How many steps are required to prove that a decision problem [7M]
is NP-Complete? Justify.
2 of 2
|'''|'|'|''|''||'|||