0% found this document useful (0 votes)
22 views

Design and Analysis of Algorithms

DAA
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views

Design and Analysis of Algorithms

DAA
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Code No: R2031052 R20 SET - 1

III B. Tech I Semester Regular Examinations, Dec/Jan – 2022-23


DESIGN AND ANALYSIS OF ALGORITHMS
(Common to CSE, IT)
Time: 3 hours Max. Marks: 70
Answer any FIVE Questions ONE Question from Each unit
All Questions Carry Equal Marks
*****
UNIT-I
1. a) Describe best case, average case and worst case efficiency of an [7M]
algorithm.
b) Write an algorithm for linear search and analyze the algorithm [7M]
for its time complexity.
(OR)
2. a) Mention the important advantages and disadvantages of using [7M]
randomized algorithms.
b) Differentiate performance measurement and performance [7M]
estimation of algorithms.
UNIT-II
3. a) Write and explain the control abstraction for Divide and Conquer [7M]
approach.
b) Trace the quick sort algorithm to sort the list C, O, L, L, E, G, E [7M]
in alphabetical order.
(OR)
4. a) What is minimum spanning tree? Explain the Kruskal’s [7M]
algorithm to find the minimum spanning by taking an
illustrative graph
b) How many ways we can merge the files on optimal merge [7M]
pattern?
UNIT-III
5. a) List the drawback of Divide and Conquer method, how can you [7M]
address these in Dynamic Programming?
b) Use the function OBST to compute w(i,j), r(i,j), and c(i,j), 0 ≤ i < j [7M]
≤ 4, for the identifier set (a1, a2, a3, a4) = (do, if, int, while) with
p(1 : 4) = (3, 3, 1, 1) and q(0:4)=(2,3,1,1,1). Using the r(i,j)’s
construct the optimal binary search tree.
(OR)
6. a) Illustrate the working principle of Dynamic Programming with [7M]
All Pairs Shortest Path problem.
b) Write dynamic programming solution for the Traveling Sales [7M]
Person problem for the network with the cost adjacency matrix
below. Assume node 1 as the home city.
0 10 15 30
4 0 9 11
5 13 0 10
7 7 8 0

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

III B. Tech I Semester Regular Examinations, Dec/Jan – 2022-23


DESIGN AND ANALYSIS OF ALGORITHMS
(Common to CSE, IT)
Time: 3 hours Max. Marks: 70
Answer any FIVE Questions ONE Question from Each unit
All Questions Carry Equal Marks
*****

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

III B. Tech I Semester Regular Examinations, Dec/Jan – 2022-23


DESIGN AND ANALYSIS OF ALGORITHMS
(Common to CSE, IT)
Time: 3 hours Max. Marks: 70
Answer any FIVE Questions ONE Question from Each unit
All Questions Carry Equal Marks
*****
UNIT-I
1. a) Explain Amortized analysis with example. [7M]
b) Compare Big-oh, Omega (Ω) and Little-oh notation. Illustrate [7M]
with an example.
(OR)
2. a) Write an algorithm for Binary search and analyze the algorithm [7M]
for its time complexity
b) Define Time Complexity. Describe different notations used to [7M]
represent these complexities
UNIT-II
3. a) Give the divide and conquer solution for Binary Search [7M]
algorithm
b) Explain the merge sort algorithm with an example. Design an [7M]
algorithm for it.
(OR)
4. a) Consider the following instance of Knapsack problem N=3, [7M]
M=20, (p1,p2,p3)=(25,24,15), (w1,w2,w3)=(18,15,10) Calculate
Maximum profit, Minimum weight and Maximum profit per unit
weight
b) What is Minimum cost spanning tree? Explain an algorithm for [7M]
generating minimum cost Spanning tree and list some
applications of it.
UNIT-III
5. a) Write and explain an algorithm to compute the all pairs shortest [7M]
path using dynamic programming and prove that it is optimal
b) 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.
(OR)
6. a) Discuss the time and space complexity of Dynamic Programming [7M]
Traveling Sales Person algorithm.
b) Compare Dynamic programming with Greedy method. [7M]
UNIT-IV
7. a) Give the solution to the 8-queens problem using backtracking [7M]
b) Write the general procedure for back tracking algorithm. [7M]
(OR)
8. a) Explain the Graph – coloring problem. And draw the state space [7M]
tree for m= 3 colors n=4 vertices graph. Discuss the time and
space complexity.
b) Explain the major drawbacks of backtracking method with [7M]
example. How can they be handled?
1 of 2

|'''|'|'|''|''||'|||
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

III B. Tech I Semester Regular Examinations, Dec/Jan – 2022-23


DESIGN AND ANALYSIS OF ALGORITHMS
(Common to CSE, IT)
Time: 3 hours Max. Marks: 70
Answer any FIVE Questions ONE Question from Each unit
All Questions Carry Equal Marks
*****

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

|'''|'|'|''|''||'|||

You might also like