21.previous Question Papers

Download as pdf or txt
Download as pdf or txt
You are on page 1of 18

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---
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
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
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: 114CS R13
JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD
B.Tech II Year II Semester Examinations, May - 2015
DESIGN AND ANALYSIS OF ALGORITHMS
(Computer Science and Engineering)

Time: 3 Hours Max. Marks: 75

Note: This question paper contains two parts A and B.


Part A is compulsory which carries 25 marks. Answer all questions in Part A.
Part B consists of 5 Units. Answer any one full question from each unit.
Each question carries 10 marks and may have a, b, c as sub questions.

PART- A
(25 Marks)
1.a) Explain amortized complexity [2M]
b) Show that if f(n) = amnm + …..+ a1n + a0 then f(n) = O( nm ). [3M]
c) What is AND/OR graph? [2M]
d) Take a graph of 5 nodes and traverse it in preorder, inorder, and postorder.
[3M]
e) What is traveling sales person problem? [2M]
f) Can we solve 0/1 knapsack problem with greedy method? Comment on
your answer. [3M]
g) What is Hamiltonian cycle? [2M]
h) What do you mean by bounding? [3M]
i) What is meant by non-deterministic algorithm? [2M]
j) What is NP-hard problem? [3M]

PART-B
(50 Marks)

2.a) Write and explain the control abstraction for Divide and conquer.
b) Explain the theta notation used in algorithm analysis. [6+4]
OR
3.a) Sort the records with the following index values in the ascending order
using quick sort algorithm. 2, 3, 8, 5, 4, 7, 6, 9, 1
b) What is probabilistic analysis? Give example. [6+4]

4.a) What is weighting rule for Union(i,j)? How it improves the performance
of union operation?
b) What is biconnected graph? [6+4]
OR
5.a) Explain the Find algorithm with collapsing rule
b) What is spanning tree? [6+4]

6.a) What do you mean by forward and backward approach of problem solving in
Dynamic Programming?
b) What is greedy strategy? [6+4]
www.ManaResults.co.in
OR
7.a) Discuss about all pairs shortest path problem with suitable example.
b) Discuss briefly about the minimum cost spanning tree. [6+4]
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]
OR
9. What is sum-of-subsets problem? Write a recursive backtracking
algorithm for sum of subsets problem. [10]

10.a) Discuss about cook’s theorem.


b) What is the satisfiability problem? [6+4]
OR
11.a) Explain the classes of P and NP.
b) Differentiate between NP-complete and NP-Hard. [6+4]

--ooOoo--

www.ManaResults.co.in
www.ManaResults.co.in
www.ManaResults.co.in
Code No: 114CS R13
JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD
B.Tech II Year II Semester Examinations, May - 2016
DESIGN AND ANALYSIS OF ALGORITHMS
(Computer Science and Engineering)
Time: 3 Hours Max. Marks: 75

Note: This question paper contains two parts A and B.


Part A is compulsory which carries 25 marks. Answer all questions in Part A.
Part B consists of 5 Units. Answer any one full question from each unit.
Each question carries 10 marks and may have a, b, c as sub questions.

PART- A (25 Marks)


1.a) List the asymptotic notations. [2]
b) Explain the time complexity of merge sort. [3]
c) Define graph. [2]
d) Explain the properties of strongly connected components. [3]
e) Give brief description on greedy method. [2]
f) What is multistage graph? [3]
g) Write the applications of Branch and Bound problem. [2]
h) What is sum of subsets problem? [3]
i) What is NP-Hard? [2]
j) Explain non-deterministic algorithm. [3]

PART-B (50 Marks)


2.a) What is an algorithm? Explain its characteristics.
b) Explain the strassen’s matrix multiplication. [5+5]
OR
3.a) Discuss about space complexity in detail.
b) Write an algorithm for quick sort. Explain with an example. [5+5]

4.a) Describe Union and Find algorithms.


b) Explain the BFS algorithm with example. [5+5]
OR
5.a) Write a nonrecursive algorithm for preorder traversal of a binary tree T.
b) Explain game tree with an example. [5+5]

6.a) Write a greedy algorithm to the job sequencing with deadlines.


b) Define merging and purging rules in 0/1 knapsack problem. [5+5]
OR
7.a) Differentiate between greedy method and dynamic programming.
b) Explain the Kruskal’s algorithm with an example. [5+5]

8. Draw the portion of the state space tree generated by LCBB for the following
instances:
n=5, m=12, (P1 P5) = (10, 15, 6, 8, 4) (w1 w5) = (4, 6, 3, 4, 2) [10]
……….. …………
OR
9.a) Describe Backtracking technique to m-coloring graph.
b) Briefly explain n-queen problem using backtracking. [5+5]
www.ManaResults.co.in
10.a) Explain the classes of NP-Hard and NP-Complete.
b) Explain the satisfiability problem. [5+5]
OR
11.a) Explain the strategy to prove that a problem is NP hard.
b) Explain the non-deterministic sorting problem. [5+5]

---ooOoo---

www.ManaResults.co.in
Code No: 114CS R13
JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD
B.Tech II Year II Semester Examinations, October/ November- 2016
DESIGN AND ANALYSIS OF ALGORITHMS
(Computer Science and Engineering)

Time: 3 Hours Max. Marks: 75

Note: This question paper contains two parts A and B.


Part A is compulsory which carries 25 marks. Answer all questions in Part A.
Part B consists of 5 Units. Answer any one full question from each unit.
Each question carries 10 marks and may have a, b, c as sub questions.

PART- A
(25 Marks)
1.a) Define the time complexity. [2]
b) List out the reasons for the difficulties that one faces while determining the lower
bound. [3]
c) Write an algorithm of simple union. [2]
d) What are the applications of game tree? [3]
e) Write an algorithm of greedy knapsack. [2]
f) State the principle of optimality. [3]
g) Define State space tree. [2]
h) Write the control abstraction algorithm for LC search. [3]
i) What is the relation between NP-hard and NP-complete? [2]
j) Distinguish between deterministic and non deterministic algorithm. [3]

PART-B
(50 Marks)
2.a) Trace the quick sort algorithm to sort the list C, O, L, L, E, G, E in alphabetical
order.
b) Solve the following recurrence:
T(n)=4T(n/2)+n, Where n  1 and is a power of 2. [5+5]
OR
3.a) Write the non-recursive algorithm for finding the Fibonacci sequence and define
its time complexity.
b) Consider the following recurrence equation: [5+5]
 1 if n  1
T(n): T(n)= 
 T ( n  1)  n
n
o th e r w is e

4.a) Explain the graph traversal with an example.


b) Write an algorithm for AND/OR Graphs. [5+5]
OR
5.a) Write a non recursive algorithm of post order tree traversal.
b) Differentiate between BFS and DFS. [5+5]

www.ManaResults.co.in
6. Write an algorithm of Prim’s minimum cost spanning tree. [10]
OR
1 1
7. Consider 4 elements al < a2 < a3 < a4 with q(0) = , q(1) = , q(2) = q(3) =
8 16
1 1 1 1
q(4) = : p(1) = , p(2) = , p(3) = p(4) = . Construct the table of values
16 4 8 16
of W (i, j), R (i. j) and C(i, j) computed by the algorithm to compute the roots of
optimal sub trees. [10]

8. Draw the portion of the state space tree generated by LC branch and bound for an
instance n=4, (P1, P2, P3, P4)= (10,10,12,18), (w1, w2, w3, w4)=(2, 4, 6, 9), and
m=15. [10]
OR
9.a) Explain the 4-queen problem using backtracking.
b) Draw the state space tree for m-coloring graph. [5+5]

10.a) Show that the HAMILTONIAN_CYCLE problem on directed graphs is NP-


complete.
b) State the cook’s theorem. What is the significance of this theorem? [5+5]
OR
11.a) Prove that CNF satisfiability of AND/OR graph decision problem.
b) Explain the classes of NP-hard and NP-complete. [5+5]

---ooOoo---

www.ManaResults.co.in
www.ManaResults.co.in
www.ManaResults.co.in
www.FirstRanker.com www.FirstRanker.com

Code No: 135AF


R16
JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD
B. Tech III Year I Semester Examinations, May/June - 2019
DESIGN AND ANALYSIS OF ALGORITHMS
(Common to CSE, IT)
Time: 3 hours Max. Marks: 75

Note: This question paper contains two parts A and B.


Part A is compulsory which carries 25 marks. Answer all questions in Part A. Part B
consists of 5 Units. Answer any one full question from each unit. Each question carries
10 marks and may have a, b, c as sub questions.

PART - A
(25 Marks)

1.a) In what way a time complexity differs from space complexity. [2]
b) Give the general plan of divide and conquer algorithms. . [3]
c) Write an algorithm for collapsing find. [2]
d) Define Backtracking? List the applications of Backtracking [3]
e) What is the importance of knapsack algorithm in our daily life? [2]
f) Write Control Abstraction of Greedy method. [3]
g) What you mean by dynamic programming. [2]
om

h) Define optimal binary search tree with an example. [3]


i) State the difference between FIFO and LC Branch and Bound algorithms. [2]
r.c

j) Write the Control Abstraction of Least – Cost Branch and Bound. [3]
ke

PART - B
an

(50 Marks)
tR
irs

2.a) What are the different mathematical notations used for algorithm analysis.
b) Write Divide – And – Conquer recursive Quick sort algorithm and analyze the
.F

algorithm for average time complexity. [10]


w

OR
w
w

3. Write Randomized algorithm of Quicksort. [10]

4. Write an algorithm to determine the Hamiltonian cycle in a given graph using


backtracking. [10]
OR
5. Explain the AND/OR graph problem with an example. [10]

6.a) Explain the Knapsack problem with an example.


b) Write a greedy algorithm for sequencing unit time jobs with deadlines and profits.
[10]
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
(d1, d2, d3, d4, d5) =(2, 2, 1, 3, 3). [10]

www.FirstRanker.com
www.FirstRanker.com www.FirstRanker.com

8. Draw an Optimal Binary Search Tree for n=4 identifiers (a1,a2,a3,a4) = ( do, if, read,
while) P(1:4)=(3,3,1,1) and Q(0:4)=(2,3,1,1,1). [10]
OR
9. Explain how Matrix – chain Multiplication problem can be solved using dynamic
programming with suitable example. [10]

10. Solve the Travelling Salesman problem using branch and bound algorithms. [10]
OR
11. Explain the FIFO BB 0/1 Knapsack problem procedure with the knapsack instance for
n=4, m=15,(p1,p2,p3,p4)=(10,10,12,18), (w1,w2,w3,w4) =(2, 4, 6, 9). Draw the portion
of the state space tree and find optimal solution. [10]

---ooOoo---
om
r.c
ke
an
tR
irs
.F
w
w
w

www.FirstRanker.com
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---

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy