0% found this document useful (0 votes)
53 views7 pages

Daa Prev

Uploaded by

Shiva Charan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
53 views7 pages

Daa Prev

Uploaded by

Shiva Charan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Code No: 155EV R18

JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD


B. Tech III Year I Semester Examinations, January/February - 2023
DESIGN AND ANALYSIS OF ALGORITHMS
JN
(Common to CESE, CSE(CS), CSE(AIML), CSE(DS), CSE(N))
Time: 3 Hours Max. Marks: 75
TU
Note: i) Question paper consists of Part A, Part B.
ii) Part A is compulsory, which carries 25 marks. In Part A, Answer all questions.
iii) In Part B, Answer any one question from each unit. Each question carries 10 marks
and may have a, b as sub questions.
H
PART – A
(25 Marks)
U
1.a) Explain amortized complexity. [2]
b) How can we measure an algorithm’s running time? [3]
se
c) What is AND/OR graph? [2]
d) State graph coloring problem. [3]
e) Write any two characteristics of a Greedy Algorithm. [2]
d
f) What is the importance of knapsack algorithm in our daily life? [3]
g) What is Hamiltonian cycle? [2]
h) Define spanning tree. [3]
pa
i) What is meant by non-deterministic algorithm? [2]
j) What is NP-hard problem? [3]
pe
PART – B
(50 Marks)

2.a) Sort the records with the following index values in the ascending order using quick sort
rs
algorithm. 2, 3, 8, 5, 4, 7, 6, 9, 1 [5+5]
b) What is probabilistic analysis? Give example.
OR
20
3.a) Give the general plan of divide and conquer algorithms. [5+5]
b) What are the different mathematical notations used for algorithm analysis.
23
4. Given a set of non-negative integers {10, 7, 5, 18, 12, 20, 15}, and a value sum 35.
Explain sum of subsets problem illustrating the above example. [10]
OR
5.a) What is weighting rule for Union(i, j)? How it improves the performance of union
operation?
b) Give brief note on graph coloring. [5+5]
6.a) Discuss about all pairs shortest path problem with suitable example.
b) Discuss briefly about the minimum cost spanning tree. [5+5]
JN
OR
7. State the Job – Sequencing with deadlines problem. Find an optimal sequence to the
n = 5 Jobs where profits (P1, P2, P3, P4, P5) = (20, 15, 10, 5, 1) and deadlines
TU
(d1, d2, d3, d4, d5) =(2, 2, 1, 3, 3). [10]

8. Draw the portion of the state space tree generated by LCBB for the knapsack instances:
n=5, (P1, P2,… , P5) = (12,10,5,9,3), (w1, w2, ...,w5)=(3, 5, 2, 5, 3) and M =12. [10]
H
OR
9. Explain how Matrix – chain Multiplication problem can be solved using dynamic
programming with suitable example. [10]
U
10. Solve the Travelling Salesman problem using branch and bound algorithms. [10]
OR
se
11.a) Discuss about cook’s theorem.
b) What is the satisfiability problem? Explain. [5+5]
d
---ooOoo---
pa
pe
rs
20
23
R18
us
Code No: 156AN
JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD
B. Tech III Year II Semester Examinations, February/March - 2022
ed
DESIGN AND ANALYSIS OF ALGORITHMS
(Computer Science and Engineering)
Time: 3 Hours Max. Marks: 75
Answer any five questions
All questions carry equal marks
pa
---

1.a) Discuss in detail various notations used for expressing the time complexity of
pe
algorithms, with examples.
b) What is Performance Analysis? Explain Space Complexity and Time Complexity with
examples. [7+8]
rf
2.a) Explain the process of merge sort by a list of any 11 integers (distributed randomly).
Write the algorithm and analyze its time complexity.
eb
b) Write an algorithm to find matrix multiplication using Strassen’s. [8+7]

3.a) Describe the Backtracking technique to the m-coloring graph. Explain with an example.
b) Write an algorithm of weighted union and also compute the time complexity of the
/m
same. [8+7]

4.a) Draw the state space tree for ‘m’ coloring when n=3 and m=3.
ar
b) Write an algorithm for the 8-queens problem using backtracking. [8+7]

5.a) Solve the solution for 0/1 knapsack problem using dynamic programming:
-2
(p1,p2,p3, p4) = (11, 21, 31, 33), (w1, w2, w3, w4) = (2, 11, 22, 15), M=40, n=4.
b) State the principle of optimality in dynamic programming. How to apply this to the
0
shortest path problem? [8+7]
22
6.a) Explain about OBST.
b) Write an algorithm of all pairs shortest path problem. [8+7]

7. Explain the problem of job sequencing with deadlines by taking an example. Write the
jn
algorithm to solve the problem using the Greedy Method. Show how the algorithm
solves the following job sequencing with deadlines problem.
n = 4, (p1, p2, p3, p4) = (100, 10, 15, 27) and (d1, d2, d3, d4) = (2, 1, 2, 1) [15]
tu
8.a) Explain Cook’s theorem with an example.
h
b) Discuss the FIFO branch and bound. [8+7]

---oo0oo---
Code No: 156AN R18
JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD
B. Tech III Year II Semester Examinations, February - 2023
DESIGN AND ANALYSIS OF ALGORITHMS
JN
(Common to CSE, ITE)
Time: 3 Hours Max. Marks: 75

Note: i) Question paper consists of Part A, Part B.


TU
ii) Part A is compulsory, which carries 25 marks. In Part A, Answer all questions.
iii) In Part B, Answer any one question from each unit. Each question carries 10 marks
and may have a, b as sub questions.
H
PART – A
(25 Marks)
U
1.a) What is an algorithm? [2]
b) Explain about big-oh notation. [3]
se
c) Define static space tree. [2]
d) Write and explain general iterative backtracking method. [3]
e) What is the time complexity of all pairs shortest path? [2]
d
f) Explain about OBST. [3]
g) What is Greedy method? [2]
h) Distinguish between Prim’s and Kruskal’s algorithms. [3]
pa
i) Define branch and bound technique. [2]
j) Explain about non-deterministic algorithms. [3]

PART – B
pe
(50 Marks)

2.a) Write and explain the general method of divide-and-conquer strategy.


rs
b) Derive the time complexity of Strassen’s matrix multiplication. [5+5]
OR
3.a) Write and explain recursive algorithm of binary search method.
20
b) What is space complexity? Explain with suitable examples. [5+5]

4.a) Describe recursive formulation of backtracking technique.


b) How to implement disjoint sets? Explain. [5+5]
23
OR
5.a) Explain about 4-queens problem with backtrack solution.
b) Discuss about number of connected components of a graph using disjoint set union.
[5+5]

6. Use the function OBST to compute w(i, j), r(i, j), and c(i, j), 0 ≤ i < j ≤ 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. [10]
OR
7. Discuss about all pairs shortest problem using dynamic programming. [10]
8. Compute a minimum cost spanning tree for the graph shown below using
a) Prim’s algorithm and
b) Kruskal’s algorithm. [5+5]
JN
TU
H

OR
U
9. Explain about single source shortest path problem in Greedy method. [10]
se
10. Describe LC branch and bound solution of 0/1 Knapsack problem in detail. [10]
OR
11. Explain the following:
d
a) Nondeterministic knapsack algorithm
b) FIFO branch and bound. [5+5]
pa
---ooOoo---
pe
rs
20
23
R18
U
Code No: 156AN
JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD
SE
B. Tech III Year II Semester Examinations, August/September - 2021
DESIGN AND ANALYSIS OF ALGORITHMS
(Computer Science and Engineering)
Time: 3 Hours Max. Marks: 75
Answer any five questions
D
All questions carry equal marks
---
PA
1.a) Write and explain randomized quick sort algorithm.
b) Discuss about Big oh O, Omega Ω and Theta θ notations with examples. [8+7]

2.a) Using Merge sort, sort the following elements:


PE
310, 285, 179, 652, 351, 423, 861, 254, 450, 520
b) Analyze the computing time complexity of binary search algorithm. [7+8]

3.a) Show that depth first search can be used to find the connected components of an
R
undirected graph.
b) Write an algorithm of n-queen’s problem and explain. [8+7]
SA
4. Suppose we start with n sets, each containing a distinct element.
a) Show that if u unions are performed, then no set contains more than u+1 elements.
b) Show that at most n – 1 unions can be performed before the number of sets
U
becomes 1.
c) Show that if fewer than (n/2) unions are performed, then at least one set with a single
element in it remains.
G
[5+5+5]

5.a) Solve the following 0/1 Knapsack Problem using dynamic programming
/S
n=4, m=30, (w1,w2,w3,w4) = (10,15,6,9) and (p1, p2, p3, p4) = (2,5,8,1).
b) Explain the concept of the traveling salesperson problem. [7+8]
EP
6. Use the function OBST to compute w(i,j), r(i,j), and c(i,j), 0 ≤ i < j ≤ 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. [15]
-
7.a) Explain the general method of Greedy method.
20
b) Write and explain the Kruskal’s algorithm with an illustrative example. [7+8]

8.a) Explain with respect to branch and bound 0/1 knapsack problem.
21
b) Discuss in detail about the classes of NP-hard and NP-complete. [7+8]

---ooOoo---
Code No: 156AN R18
JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD
jn
B. Tech III Year II Semester Examinations, August - 2022
DESIGN AND ANALYSIS OF ALGORITHMS
(Common to CSE, ITE)
t
Time: 3 Hours Max.Marks:75
uh
Answer any five questions
All questions carry equal marks
---
us
1. Show that the following equalities are correct:
a) 5n2 - 6n = θ (n2)
b) n! = O(nn)
ed
c) 2n22n + n log n = θ (n22n)
d) n3 + 106n2 = θ (n3). [4+4+4+3]

2.a) What are asymptotic notations? Explain with examples.


b) Write and explain quick sort algorithm with an example. [8+7]
pa
3.a) Write and explain find algorithm with collapsing rule.
b) Describe the general method of backtracking. [8+7]
pe
4.a) What are union and find operations? Explain with suitable examples.
b) Explain about graph coloring algorithm. [8+7]
ra
5.a) Solve the following 0/1 knapsack problem using dynamic programming
n=3, (W1, W2, W3) = (2, 3, 3) (P1, P2, P3) =(1,2,4) and m=6.
ug
b) Differentiate between dynamic programming and divide and conquer. [8+7]

6. Consider four elements a1 < a2 < a3 < a4 with q(1, 2, 3, 4) = (1/8, 3/16, 1/16, 1/16) and
-2
(p1, p2, p3, p4) = (1/4, 1/8, 1/16, 1/16). Construct the table of values of W (i, j), R(i, j)
and C(i, j) computed by the algorithm to compute the roots of optimal sub-tree. [15]
02
7.a) Describe Greedy method control abstraction for the subset paradigm.
b) Write an algorithm of Greedy knapsack. [8+7]

8.a) Write a non-deterministic algorithm of sorting a list of elements in an array.


2
b) Explain the applications of branch and bound. [8+7]

---oo0oo---

You might also like