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

Computer Course Daa

The document discusses 10 questions related to algorithms design and analysis across 5 units. The questions cover topics like time complexity analysis, sorting algorithms, graph algorithms, dynamic programming, and complexity classes. Students are required to answer 5 questions with each question carrying equal marks.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views

Computer Course Daa

The document discusses 10 questions related to algorithms design and analysis across 5 units. The questions cover topics like time complexity analysis, sorting algorithms, graph algorithms, dynamic programming, and complexity classes. Students are required to answer 5 questions with each question carrying equal marks.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Code No: R2032423 R20 SET -1

III B. Tech II Semester Regular Examinations, July -2023


DESIGN AND ANALYSIS OF ALGORITHMS
(Common to CSE(AIML),CSE(AI),CSE(DS)CSE(AIDS), AIDS,AIML)
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 linear search and analyze the algorithm for its time [7M]
complexity
b) Write a short notes on probabilistic analysis. Discuss its role in Algorithmic [7M]
analysis.
(OR)
2. a) Write the properties of algorithm and various fields of study in algorithms. [7M]
b) Differentiate performance measurement and performance estimation of [7M]
algorithms
UNIT-II
3. a) Design an algorithm to sort the given list of elements using Quick Sort [7M]
incorporating divide and conquer technique. Sort the following list using the
same and compute its average case time efficiency: 8, 3, 0, 9, 6, 1, 3, 4.
b) Consider the following instance of Knapsack problem N=3, M=20, [7M]
(p1,p2,p3)=(25,24,15), (w1,w2,w3)=(18,15,10) Calculate Maximum profit,
Minimum weight and Maximum profit per unit weight.
(OR)
4. a) Explain the merge sort algorithm 310, 285, 179, 652, 351, 423, 861, 254, 450, [7M]
520. Derive the time complexity from T(n)=2T(n/2) +cn
b) Explain single source shortest path Problem with example. [7M]
UNIT-III
5. a) Use the function OBST to compute w(i,j), r(i,j), and c(i,j), 0 ≤ i < j ≤ 4, for the [9M]
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
b) Write and explain an algorithm to compute the all pairs shortest path using [5M]
dynamic programming and prove that it is optimal.
(OR)
6. a) Solve the following 0/1 Knapsack problem using dynamic programming P= [7M]
(11, 21, 31, 33), W= (2, 11, 22, 15), C=40, n=4.
b) Discuss the time and space complexity of Dynamic Programming traveling [7M]
sales person algorithm.
UNIT-IV
7. a) Write an algorithm for sum of subsets problem. [7M]
b) Find a solution to the 8-Queens problem using backtracking strategy. Draw the [7M]
solution space using necessary bounding function
(OR)
8. a) Describe the algorithm for Hamiltonian cycles and Determine the order of [7M]
magnitude of the worst-case computing time for the backtracking procedure
that finds all Hamiltonian cycles.
b) Write the algorithm for general iterative backtracking method and explain [7M]
various factors that define the efficiency of backtracking
1 of 2

|''|'||||''|'''|||'|
Code No: R2032423 R20 SET -1

UNIT-V
9. a) State and prove Cook’s theorem [7M]
b) Explain the P, NP, NP-Hard and NP- complete classes with suitable examples [7M]
(OR)
10. a) Write about non deterministic algorithms and choice, failure and success [7M]
functions with search example
b) Using an example prove that, satisfiability of boolean formula in 3-Conjunctive [7M]
Normal form is NP-Complete.

2 of 2

|''|'||||''|'''|||'|
Code No: R2032423
R203105O
R2031011
R2031351
R203135A
R203147A
R203147C
P2031051 R20 SET
SET
RA--22

III B. Tech II Semester Regular Examinations, July -2023


DESIGN AND ANALYSIS OF ALGORITHMS
(Common to CSE(AIML),CSE(AI),CSE(DS)CSE(AIDS), AIDS,AIML)
Time: 3 hours Max. Marks: 70

Answer any FIVE Questions ONE Question from Each unit


All Questions Carry Equal Marks
*****

UNIT-I
1. a) Compare Big-oh notation, Omega Ω and Little-oh notation. Illustrate with an [7M]
example.
b) Define time complexity? Explain time complexity of insertion sort in different [7M]
cases.
(OR)
2. a) Write Randomized algorithm for Quick sort. Analyze its performance with [7M]
quick sort algorithm without randomization.
b) Write an algorithm for Binary search and analyze the algorithm for its time [7M]
complexity
UNIT-II
3. a) Explain Defective chess board Problem with example [7M]
b) Write Prim’s algorithm to generate minimum cost spanning tree for the given [7M]
graph

(OR)
4. a) Design the algorithm to find the minimum and maximum element of given [7M]
array and derive its time complexity.
b) Explain the Knapsack problem. Find an optimal solution to the Knapsack [7M]
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).
UNIT-III
5. a) Draw an Optimal Binary Search Tree for n=4 identifiers (a1,a2,a3,a4) = ( do, [7M]
if, read, while) P(1:4)=(3,3,1,1) and Q(0:4)=(2,3,1,1,1).
b) Write and explain an algorithm to compute the all pairs shortest path using [7M]
dynamic programming and prove that it is optimal
(OR)

1 of 2

|''|'||||''|'''|||'|
Code No: R2032423 R20 SET -2

6. a) Write dynamic programming solution for the traveling sales person problem [7M]
for the network with the cost adjacency matrix. Assume node 1 as the home
city.
0 10 15 30
4 0 9 11
5 13 0 10
7 7 8 0
b) Compute All pairs-shortest
shortest path for following graph [7M]

UNIT-IV
7. a) Find all m-colors
colors of a graph with undirected connections v1
v1->2, v1-->v3, v1- [7M]
>v4, v2->v3, v2->v4,
>v4, v2
v2->v5, v3->v4, v4->v5
>v5 using backtracking technique.
b) What is sum-of-subsets
subsets problem? Write a recursive backtracking algorithm for [7M]
sum of subsets problem.
(OR)
8. a) Explain the Graph – coloring problem. And draw the state space tree for m= [7M]
3colors n=4 vertices graph. Discuss the time and space complexity
b) Briefly explain n-queen
queen problem using backtracking [7M]
UNIT-V
9. a) Explain the strategy to prove that a problem is NP hard
hard. [7M]
b) Is Travelling salesman problem NPNP-hard or NP-Complete?
Complete? Justify your answer. [7M]
(OR)
10. a) Show that the HAMILTONIAN_CYCLE problem on directed graphs is NP NP- [7M]
complete
b) Relate deterministic problems, NP problems, NP hard and NP complete [7M]
problems. Discuss the examples.

2 of 2

|''|'||||''|'''|||'|
Code No: R2032423 R20 SET -3

III B. Tech II Semester Regular Examinations, July -2023


DESIGN AND ANALYSIS OF ALGORITHMS
(Common to CSE(AIML),CSE(AI),CSE(DS)CSE(AIDS), AIDS,AIML)
Time: 3 hours Max. Marks: 70

Answer any FIVE Questions ONE Question from Each unit


All Questions Carry Equal Marks
*****
UNIT-I
1. a) What are the different mathematical notations used for algorithm analysis [7M]
b) Write about the program step count and frequency count methods used to [7M]
estimate the performance of an algorithm with an example.
(OR)
2. a) Write algorithm for calculating multiplication of matrices and derive its time [7M]
complexity using step count method
b) Give the asymptotic bounds for the equation f(n)=2n3-6n+30 and represent in [7M]
terms of Ɵ notation.
UNIT-II
3. a) Trace the quick sort algorithm to sort the list J,N,T,U,K,U, N, I, V, E, R, [7M]
S,I,T,Y in alphabetical order. And show that the average case time
complexity is O(n loge n)
b) Write and explain the general method of divide-and-conquer strategy .Describe [7M]
binary search in detail and provide time complexity analysis with an example
(OR)
4. a) Apply the greedy method to solve Knapsack problem for given instance [7M]
Where n=3, m=20, (p1,p2,p3)=(25,24,15), and weight (w1,w2,w3)=(18,15,10).
b) Construct the minimum cost spanning tree using Krushkal algorithm for the [7M]
given graph and explain the algorithm.

1 of 2

|''|'||||''|'''|||'|
Code No: R2032423 SET -3
R20

UNIT-III
5. a) Solve the following instance of 0/1 KNAPSACK problem using Dynamic [7M]
programming n = 3, (W1, W2, W3) = (2, 3, 4), (P1, P2,P3) = (1, 2, 5), and m =
6.
b) Write dynamic programming solution for the traveling sales person problem [7M]
for the network with the cost adjacency matrix. Assume node 1 as the home
city.
0 10 15 30
4 0 9 11
5 13 0 10
7 7 8 0
(OR)
6. a) Illustrate the working principle of dynamic programming with all pairs shortest [7M]
path problem.
b) Draw an Optimal Binary Search Tree for n=4 identifiers (a1,a2,a3,a4) = ( do, [7M]
if, read, while) P(1:4)=(3,3,1,1) and Q(0:4)=(2,3,1,1,1)
UNIT-IV
7. a) Write backtracking algorithm of Graph coloring problem and derive its time [7M]
complexity
b) Write backtracking algorithm of N-Queens problem and derive [7M]
its time complexity
(OR)
8. a) find the solutions for the subset sum for N=7, m=35, w={5,7,10,12,15,18,20} [7M]
using back tracking approach.
b) Explain how the Hamiltonian circuit problem is solved by using the [7M]
backtracking concept.
UNIT-V
9. a) State and prove Cook’s theorem [7M]
b) Explain the classes of NP-Hard and NP-Complete. [7M]
(OR)
10. a) Write a non-deterministic algorithm of sorting a list of elements in an array. [7M]
b) Explain Nondeterministic knapsack algorithm. [7M]

2 of 2

|''|'||||''|'''|||'|
Code No: R2032423
R2031011
R2031351
R203135A
R203147A
R203147C
R203105O
P2031051 R20 SET
SET
RA--42

III B. Tech II Semester Regular Examinations, July -2023


2023
DESIGN AND ANALYSIS OF ALGORITHMS
(Common to CSE(AIML),CSE(AI),CSE(DS)CSE(AIDS), AIDS,AIML)
Time: 3 hours Max. Marks: 70
Answer anyny FIVE Questions ONE Question from Each unit
All Questions Carry Equal Marks
*****
UNIT-I
1. a) Write Randomized algorithm of Quick sort with example. Show the [7M]
performance difference with out randomization.
b) Describe asymptotic notations Big Oh (O), Omega (Ω) and Theta (Ɵ Ɵ) notations [7M]
and show their behavior using graphical representation
representation.
(OR)
2. a) Write the algorithm for finding the factorial of given number and estimate the [7M]
time complexity. [7M]
b) What is Performance Analysis? Explain Space Complexity and Time
Complexity with examples
examples.
UNIT-II
3. a) Design an algorithm to sort the given list of elements using Merge Sort [7M]
incorporating divide and conquer technique. Sort the following list using the
same and compute its time efficiency: 4, 2, 0, 8, 7, 1, 3, 6
b) Generate the shortest path from single source (A) and explain the algorithm
algorithm. [7M]

(OR)
4. a) Explain the concept of minimum cost spanning tree? What are the different [7M]
algorithms exist for obtaining minimum cost spanning tree. Compute the
minimum cost spanning tree using Prim’s algorithm for the given graph. Draw
the spanning tree generated at each step
step.

1 of 2

|''|'||||''|'''|||'|
Code No: R2032423 R20 SET -4

b) Write greedy algorithm for knapsack problem. Find the solution for the [7M]
following Knapsack problem using greedy method
(p1,p2,p3,p4)=(2,5,8,1), (w1,w2,w3,w4)=(10,15,6,9) and m=30
UNIT-III
5. a) Solve the following 0/1 Knapsack Problem using dynamic programming n=4, [7M]
m=30, (w1,w2,w3,w4) = (10,15,6,9) and (p1, p2, p3, p4) = (2,5,8,1)
b) Use the function OBST to compute w(i,j), r(i,j), and c(i,j), 0 ≤ i < j ≤ 4, for the [7M]
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) Address the problem of multistage graph using dynamic programming. [7M]

b) Construct an optimal travelling salesperson tour using [7M]


Dynamic Programming for the given data:

UNIT-IV
7. a) Explain the key concepts of backtracking and state space tree with about 8- [7M]
queens problem.
b) Explain the Graph–coloring problem. Draw the state space tree . [7M]
(OR)
8. a) Find a solution to sum of subsets problem using backtracking strategy. Draw [7M]
the solution space using necessary bounding function m=12 with items
(2,3,1,4,5,6,7) n=7
b) Explain the major drawbacks of backtracking method with example. [7M]
UNIT-V
9. a) Differentiate between deterministic and non deterministic algorithm.. [7M]
b) Discuss in detail about the classes of NP-hard and NP-complete. [7M]
(OR)
10. a) Explain circuit satisfiability problem with a circuit diagram. Show that circuit [7M]
satisfiability problem is NP- hard.
b) Compare NP Hard and NP Complete. [7M]

2 of 2

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

You might also like