Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Daa Question Paper Winter 2024

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

Rashtrasant Tukadoji Maharaj Nagpur University

Faculty of Science & Technology


Fifth Semester B.Tech. (Computer Science & Engineering (AI & ML) (Computer Science &
Engineering) (Computer Science) (C.B.C.S.) Examination 2024
Design and analysis of Algorithm
P. Page: 8 PRS/KW/24/2694
Time-Three Hours [Maximum Marks-70]

NSTRUCTIONS TO CANDIDATES
(1) All questions carry marks as indicated.
(2) Solve Question No. 1 OR Question No. 2.
(3) Solve Question No. 3 OR Question No. 4.
(4) Solve Question No. 5 OR Question No. 6.
(5) Solve Question No. 7 OR Question No. 8.e
(6) Solve Question No. 9 OR Question No. 10.

Unit 1
1. What are the different asymptotic notations? Explain them briefly.
2. Solve the following recurrence relation using characteristic equation

3. Explain principle of designing algorithm. Also write its characteristics.


4. Explain principles of designing on algorithm in brief.
5. Solve the following using master theorem: i) T(n)= 4T(n/2) +n² ii) T(n)=2T(n/2) +n
6. What is sorting Network? Explain half cleaner circuit. Design a 8 bit bitonic sorting network and
explain its operation for 1,7,5, 8, 2,6,9,3.
7. Explain Asymptotic notations. Find upper bound, lower bound and tight bound range for
following 1) 2In+9n+6 2) 5n+12 (3) 20n2+ 8n +n (4) 2n +5
8. Solve the following using master method.
9. Explain best case, worst case and average case analysis with example.
10. Solve the following Recurrence. T(n) =0 if n=0 T(n) =5 if n=5 T(n)= 3t(n-1)+4t(n-2), otherwise
11. What is significance of Amortized analysis? Explain all its 3 methods.
12. What is an algorithm? Discuss the parameters and phase of algorithm.

Unit 2

1. Solve Job sequencing with deadlines n =4, P = (100,10, 15, 27) and d = (2, 1, 2, 1) find optimal
solution. Also write algorithm for the same.
2. Write an algorithm for Huffman code? Implement it on the following data and variable length
encoding. A : 45 B :13 C :12 D :16 E :09 F :05
3. Find the multiplication of following matrices A &B given below using Strassen's matrix
multiplication algorithm and calculate its complexity.

4. Solve the following using partial knapsack. n =7 and M= 15 (P1, P2..P7)=(15,20, 10,7,6,18,3) (w1,
w2....w7) =(2,3,5,7,1,4,1)
5. Give stepwise operation on Heap sort on the following input array and also explain the
complexity of heap sort: 4, 8, 20, 17, 7, 25, 2, 13, 5
6. Write an algorithm for binary search. Find its complexity. Also find out average number of
successful and unsuccessful comparison on the following array : -12,23, 31, 45, 56, 78, 90, 103,
113, 126, 157.
7. Schedule the following jobs using job scheduling algorithm. Also write an algorithm for same:

Job Profit Deadline


1 10 2
2 5 3
3 18 4
4 20 3
5 1 2
6 6 1
7 30 2
8. Find optimal solution for knapsack problem. Using greedy strategy for following instances n=7,
m= 15.

9. Find out a average number of comparisons required for successful and unsuccessful binary
search on following array. 12, 23, 31, 45, 56, 78, 90, 103, 113, 126, 157
10. Schedule the following Jobs using Job Scheduling algorithm. Also write algorithm for the same.

11. Discuss Strassen’s matrix multiplication algorithm in detail. Also discuss its complexity.
12. Using Strassen's algorithm for matrix multiplication solve the following:

13. Write an algorithm for Huffman code? Implement it on the following data and variable length
encoding a:25, b:10, c:12, d:30, e:35.
14. For the following knapsack sequence of objects find profit by three methods. Capacity =11, n=
4w =(1, 2, 5, 8, 7), p =(1,6, 18, 25, 30)
15. Write an algorithm to find minimum spanning tree for the following graph using PRIM's
algorithm.

Unit 3
1. Write an algorithm to generates LCS. Apply algorithm for the following string and generate LCS
X =a, a, b, a, a, b, a, b, a, a. Y =b, a, b, a, a, b, a, b.
2. Find the minimum cost path from 's' to t' in multistage graph, shown using forward approach:
3. What is Travelling Salesman Problem? Implement it for the following Matrix

4. Find the longest common subsequence for the following. x= (1,0,0, 1,0, 1, 0, 1) y= (0, 1,0, 1, 1,
0, 1, 1,0)
5. Calculate the minimum number of scalar multiplications for following set of matrix using matrix
chain multiplication. A =4x5 B=5x3 C=3x2 D=2x7
6. What is Travelling salesman problem? Implement it for the following matrix:

7. Determine LCS of X=(AGGTABZ) Y =(GXTXAYB) Write the recurrence equation for LCS.
8. Find the minimum number of multiplications required to multiply the matrices of given
dimension using chained matrix multiplication. Dimension of matrices are A =13x5, B=5x89, C
=89x3, D=3x34
9. Determine the cost and structure of optimal Binary search tree for set of n= 7 keys with the
following probabilities.

10. What is TSP? Calculate the TSP tour for following matrix.

11. Write an algorithm for Floyd War shall and calculate distance and path matrix of following:
12. Using chained matrix multiplication method find out minimum no. of operation required to
multiply. Following matrices and also find the best sequence A =6x10 B=10x12 C= 12x5 D=5x8
13. Develop LCS by using Dynamic programming algorithm. x=(A,B,C,B,D,A,B) y=(B,D,C,A,B,A)
14. Distinguish between: (1) Dynamic Programming &Greedy Strategy (2) Dynamic Programming &
Divide& Conquer.
15. Identify shortest path using travelling salesman problem.

Unit 4
1. What is 8 Queen Problem? Explain implicit and explicit constraints associated with this problem.
Give at least two solution for the problem.
2. What is Hamiltonian Cycle? For the following graph generate Hamiltonian Cycle.
3. Explain how backtrackings appliedto4-Queen's problem also draw state space tree.
4. What is Graph Coloring? Implement on following graph and generate solution space tree if
number of permitted colors is 3.
5. Place 8 Queens in 8*8 matrix such that no two queens are in same row, same column or
diagonally opposite.
6. What is Explicit and Implicit constraints of 4 Queen Problem? Explain 4 Queen Problem in detail
and give at least two solutions of 8Queen problem.
7. Perform Graph Coloring on the given graph. State the total number of possible solutions

8. What is backtracking? Obtain BFS tree DFS tree for the following graph:
9. What is graph coloring? Color the following graph using graph coloring algorithm

10. What is the use of Hamiltonian cycle? Implement Hamiltonian cycle on following graph.

11. What is back tracking? Explain implicit &Explicit constraints. Also obtain DFS tree for following
graph.

12. Write the algorithm for Breadth First Search (BES). Also perform BFS on the given graph,
showing operations using stack. State the output sequence generated.

13. Find the Hamiltonian cycle in the given graph. Also draw the solution tree showing all possible
paths.
14. What is graph coloring? Color the following graph using graph coloring algorithm.

15. What is back tracking? Explain BFS and DFS tree for the following graph

16. Draw at least two different Hamiltonian cycles from the following graph. Also draw the solution
space tree that shows all possible solutions.

Unit 5

1. Explain P, NP, NP complete and NP-Hard with suitable example.


2. Write an algorithm for non-deterministic searching and sorting.
3. Prove that P ꓴ NP.
4. Prove that P C NP
5. Prove that P = NP
6. Explain the following NP problem with respect to graph (i) Clique (i)Graph partition into triangle
(iii) Independent set problem.
7. Explain the following any three. i) CLIQUE ii) Independent set problem. iii) Graph partitioned into
triangle. iv) Polynomial reduction. v) Decision & Optimization problem.
8. Write short notes on: I) P Class Problem ii) NP-Hard iii) NP-Complete iv) Deterministic Algorithm.
9. Explain in detail the relationship between P, NP, NP-Hard and NP-complete problem with the
help of diagram.
10. What do you mean by decision and optimization problem? Explain.
11. Explain NP, NP-hard and NP-complete problems.
12. Write a short note on COOK's Theorem.
13. Explain Polynomial reduction in detail.
14. Differentiate between P and NP
15. Differentiate between NP- Hard and NP – Complete.
16. Differentiate between Deterministic and Non-Deterministic polynomial time algorithm.
17. Differentiate between decision problems and optimization problem.

You might also like