Be - Computer Engineering - Semester 7 - 2023 - November - Design and Analysis of Algorithms D Aoa Pattern 2019
Be - Computer Engineering - Semester 7 - 2023 - November - Design and Analysis of Algorithms D Aoa Pattern 2019
8
23
P-6551 [Total No. of Pages : 3
ic-
tat
[6181]-101
1s
B.E. (Computer Engineering)
6:0
02 91
DESIGN AND ANALYSIS OF ALGORITHM
3:3
0
(2019 Pattern) (Semester-I) (410241)
31
Time : 2½ Hours] 0/1 13 [Max. Marks : 70
0
Instructions to the candidates :
1/2
.23 GP
8
4) Assume suitable data, if necessary.
C
23
ic-
Q1) a) Write High-level description of job sequencing algorithm. Let number of
16
tat
8.2
jobs (n)=5; Profit vector P={20, 15, 10, 5, 1); Deadline vector D={2, 2,
1s
1, 3, 3) Find the feasible solutions. What is the optimal solution and
.24
6:0
91
maximum profit? [9]
49
3:3
b) Consider the following instance of the knapsack problem. Find the optimal
30
31
1 2 $12
0/1
2 1 $10
CE
83
8
3 3 $20
23
.23
4 2 $15
ic-
16
tat
Capacity of the knapsack = 5.
8.2
1s
OR
.24
6:0
Q2) a) What is Job scheduling algorithm? How job scheduling algorithm can be
91
49
3:3
problem. [12]
1/2
GP
Job J1 J2 J3 J4 J5
CE
83
Deadline 2 1 3 2 1
.23
Profit 60 100 20 40 20
16
P.T.O.
.24
49
Q3) a) What is branch and bound algorithmic strategy? Apply branch n bound
8
23
algorithmic strategy to solve traveling salesman problem for [9]
ic-
tat
1s
6:0
02 91
3:3
0
31
0/1 13
0
1/2
.23 GP
E
83
8
C
23
b) Explain with suitable example Backtracking: Principle, control abstraction,
ic-
time analysis of control abstraction. [8]
16
tat
8.2
OR
1s
.24
6:0
Q4) a) Explain the ‘branch and bound’ approach for solving problems. Write a
91
49
branch and bound algorithm for solving the 0/1 Knapsack problem. Use
3:3
30
the same algorithm to solve the following 0/1 Knapsack problem. The
31
Item A B C D
1/2
GP
Profit(Rs.) 18 10 12 10
0/1
Weight (Kg.) 9 4 6 2
CE
83
8
23
b) What is sum of subset problem? Solve sum of subset problem for following
.23
ic-
instance using backtracking approach [8]
16
tat
Input: set[ ] = {2, 3, 5, 6, 8, 10}, sum = 10
8.2
1s
.24
6:0
Q5) a) What is amortized analysis? Explain the aggregate method with example.[9]
91
49
3:3
30
OR
0/1
CE
83
Q6) a) What are special needs of embedded algorithm? Which sorting algorithm
.23
[6181]-101 2
49
c) What is randomized algorithm? Give any example of randomized algorithm?
8
23
Also explain Random variable, Binomial random variable and-Mathematics
ic-
for Randomized algorithm. [8]
tat
1s
6:0
Q7) a) i) Explain an algorithm for Distributed Minimum Spanning Tree.
02 91
3:3
ii) Write and explain Rabin-Karp algorithm for string matching. [10]
0
31
b)
0/1 13
With respect to Multithreaded Algorithms explain Analyzing multithreaded
0
1/2
algorithms, Parallel loops, Race conditions. [7]
.23 GP
OR
E
83
8
C
23
Q8) a) Write and explain pseudo code for Multi-threaded merge sort algorithm.
ic-
How parallel merging gives a significant parallelism advantage over Merge
16
tat
Sort? [9]
8.2
1s
b) For string matching, working module q = 11, how many spurious hits
.24
6:0
91
does the Rabin- Karp matcher encounters in Text T = 31415926535.....[8]
49
3:3
30
31
i) T = 31415926535
01
02
ii) P=26
1/2
GP
8
iv) And P mod Q = 26 mod 11 = 4
23
.23
tat
8.2
1s
.24
6:0
91
49
3:3
30
31
01
02
1/2
GP
0/1
CE
83
.23
16
8.2
.24
[6181]-101 3
49