DAA Question Bank
DAA Question Bank
DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING
SECTION – I
1. Define time and space complexity. Explain with examples. [14M]
(OR)
2. For T(n)=7T(n/2)+18n2 Solve the recurrence relation and find the time complexity. [14M]
SECTION – II
3. Explain AND/OR graphs [14M]
(OR)
4. How 8-Queen’s problem can be solved using back tracking and explain with an example. [14M]
SECTION – III
5. Explain General method of Greedy method. Find the greedy solution for following job sequencing with
deadlines problem n = 7, (p1,p2,p3,p4,p5,p6,p7) = (3,5,20,18,1,6,30), (d1,d2,d3,d4,…,d7) =
(1,3,4,3,2,1,2) [14M]
(OR)
6. a) A motorist wishing to ride from city A to B. Formulate greedy based algorithms to generate shortest
path and explain with an example graph. [7M]
b) What is the solution generated by function Job Sequencing algorithm when n=6 (P1…p6) = (3, 5, 20,
18, 1, 6), and (d1..d6) = (1, 3, 4, 3, 2, 1). [7M]
SECTION – IV
(OR)
8 Write a function to compute lengths of shortest paths between all pairs of nodes for the given adjacency
matrix.[14M]
0 6 13
8 0 4
5 ∞ 0
SECTION – V
9. Discuss Draw the portion of state space tree generated by FIFOBB for the following
instance of 0/1 knapsack n= 5, M=12, (p1, ……p5) = (10,15,6,8,4) (w1,. ... w5)=(4,6,3,4,2)[14M]
(OR)
10. (a) Write and explain the Cooks theorem. [7M]
(b) What is non deterministic algorithm explain. [7M]
*******
R18
Code No: xxxxxx
MALLA REDDY COLLEGE OF ENGINEERING & TECHNOLOGY
(Autonomous Institution – UGC, Govt. of India)
II B.Tech II Semester Model Paper-II
Design and analysis of Algorithms
(CSE & IT)
Roll No
SECTION – I
1. Illustrate Merge sort algorithm and discuss its time complexity.[14M]
(OR)
2. Explain Strassen’s matrix multiplication and its time complexity [14M]
SECTION – II
3. Discuss union and find algorithms in detail with an example. [14M]
(OR)
4. a) Explain Prim’s algorithm for minimal spanning tree with an example.[7M]
b) Write in detail about Hamiltonian cycles. Give example t o it.[7M]
SECTION – III
5. Write a greedy algorithm for sequencing unit time jobs with dead lines and profits. [14M]
(OR)
6. Derive time complexity of job sequencing with deadlines .Obtain the optimal solution when
n=5, (p1, p2,…)=(20,15,10,5,1) and (d1,d2,…)=(2,2,1,3,3).[14M]
SECTION – IV
9. Discuss in detail about the class P, NP, NP-hard and NP-complete problems. Give examples for
each class.[14M]
(OR)
10. Describe Travelling Salesperson Problem (TSP) using Branch and Bound.[14M]
*******
Code No: xxxxxx R18
MALLA REDDY COLLEGE OF ENGINEERING & TECHNOLOGY
(Autonomous Institution – UGC, Govt. of India)
II B.Tech II Semester Model Paper-III
Design and analysis of Algorithms
(CSE & IT)
Roll No
(OR)
4. Give the solution to the m-coloring of a graph using backtracking.[14M]
SECTION – III
5. Define Greedy knapsack. Find the optimal solution of the Knapsack instance n= 7, M=15, (p1, p2,
……p7) = (10,5,15,7,6,18,3) and (w1,w2,. ... w7)=(2,3,5,7,1,4,1). [14M]
(OR)
6. Write about 0/1 knapsack problem with an example.[14M]
SECTION – IV
7. Let n=4 and (a1,a2,a3,a4) Construct optimal binary search for (a1, a2, a3, a4) = (do, if, int,
while), p(1 : 4) = (3,3,1,1) q(0 : 4)= (2,3,1,1,1) [14M]
(OR)
8. Explain how solution will be provided for all pairs shortest path problem using dynamic
programming.[14M]
SECTION – V
*******
R18
Code No: xxxxxx
MALLA REDDY COLLEGE OF ENGINEERING & TECHNOLOGY
(Autonomous Institution – UGC, Govt. of India)
II B.Tech II Semester Model Paper-IV
Design and analysis of Algorithms
(CSE & IT)
Roll No
SECTION – I
1. a) Explain the process of designing an algorithm. Give characteristics of an algorithm. [7M]
b) Explain asymptotic notations. [7M]
(OR)
2. a) Give the general procedure of divide and conquer method.[7M]
b)Write about quick sort method with example.[7M]
SECTION – II
3. a) Explain about Disjoint set operations.[7M]
b) Write short notes on spanning trees. [7M].
(OR)
4. What is an articulation point? How to find articulation point for a given graph. [14M]
SECTION – III
5. Define Greedy knapsack. Find the optimal solution of the Knapsack instance n= 7, M=20, (p1, p2,
……p7) = (8,5,6,7,6,12,3) and (w1,w2,. ... w7)=(2,10,8,7,6,4,11). [14M]
(OR)
6. Give the optimal solution for 0/1 knapsack problem using greedy method.
(p1,p2,p3, p4) = (11, 21, 31, 33), (w1, w2, w3, w4) = (2, 11, 22, 15), M=40, n=4. [14M]
SECTION – IV
7. .Let n=4 and (a1,a2,a3,a4) Construct optimal binary search for (a1, a2, a3, a4) = (cout, float, if,
while), p(1 : 4) = (1/20,1/5,1/10,1/20) q(0 : 4)= (1/5,1/10,1/5,1/20,1/20) [14M]
(OR)
8. Explain optimal binary search tree with an example.14M]
SECTION – V
9. What is state space tree? What are the different ways of searching an answer node in an state space tree
explain with example. [14M]
(OR)
10. a) Write non-deterministic algorithm for knapsack problem?[7M]
b) Difference between NP-hard and NP-complete problems[7M]
*******
R17
Code No: R17A0508
MALLA REDDY COLLEGE OF ENGINEERING & TECHNOLOGY
(Autonomous Institution – UGC, Govt. of India)
II B.Tech II Semester Regular Examinations, April/May 2019
Design and Analysis of Algorithms
(CSE & IT)
Roll No
SECTION-IV
7 a. Write a depth first search algorithm for graph traversal. [7M]
b. Discuss about AND / OR graphs and game trees [7M]
OR
8 a. Define graph coloring and write an algorithm to find Hamiltonian cycles. [7M]
b. Compare and contrast between connected components and bi connected components. [7M]
SECTION-V
9 a. Explain FIFO Branch and Bound solution. [7M]
b. Differentiate between NP - Hard and NPComplete classes. [7M]
OR
10 a. Explain 0/1 knapsack problem in Branch and Bound technique. [7M]
b. Discuss about general method of branch and bound technique. [7M]
.
**********
R15
Code No: R15A0508
MALLA REDDY COLLEGE OF ENGINEERING & TECHNOLOGY
(Autonomous Institution – UGC, Govt. of India)
II B.Tech II Semester Regular/Supplementary Examinations, April/May 2018
Design and analysis of Algorithms
(CSE & IT)
Roll No
6. How do you construct a minimum Spanning tree using kruskals algorithm explain? List any two
applications. [10M]
(OR)
7. State dynamic programming. Explain with one application. [10M]
SECTION – IV
8. Explain the Travelling salesmen problem using Branch and bound technique. [10M[
(OR)
9.Give the solution to the 8 queen’s problems using backtracking. [10M]
SECTION – V
10. Discuss in detail about the class P, NP, NP-hard and NP-complete problems. Give examples
for each class. [10M]
(OR)
11. (a) Write and explain the Cooks theorem. [5M]
(b) What is non deterministic algorithm explain. [5M]
******