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

Be - Computer Engineering - Semester 7 - 2023 - November - Design and Analysis of Algorithms D Aoa Pattern 2019

The document discusses various algorithms and their applications. It includes questions about job sequencing, knapsack problems, traveling salesman problem, branch and bound algorithms, backtracking, sum of subset problems, amortized analysis and sorting algorithms for embedded systems.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views

Be - Computer Engineering - Semester 7 - 2023 - November - Design and Analysis of Algorithms D Aoa Pattern 2019

The document discusses various algorithms and their applications. It includes questions about job sequencing, knapsack problems, traveling salesman problem, branch and bound algorithms, backtracking, sum of subset problems, amortized analysis and sorting algorithms for embedded systems.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Total No. of Questions : 8] SEAT No.

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

1) Answer Q1 or Q2, Q3 or Q4, Q5 or Q6, Q7 or Q8.


2) Neat diagrams must be drawn wherever necessary.
3) Figures to the right indicate full marks.
E
83

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

solution by using dynamic programming approach. [9]


01
02

Item Weight Profit


1/2
GP

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

solved using Greedy algorithmic approach? Explain your answer with


30

respect to Principle, control abstraction, time analysis of control


31

abstraction, of greedy approach for the following instance of Knapsack


01
02

problem. [12]
1/2
GP

Each job is associated with a deadline and profit.


0/1

Job J1 J2 J3 J4 J5
CE
83

Deadline 2 1 3 2 1
.23

Profit 60 100 20 40 20
16

b) Write steps for Greedy approach for Job sequencing. [6]


8.2

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

capacity of the knapsack is 15 kg. [9]


01
02

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

b) What is Potential function method of amortized analysis? To illustrate


31

Potential method, find amortized cost of PUSH, POP and MULTIPOP


01
02

stack operations. [9]


1/2
GP

OR
0/1
CE
83

Q6) a) What are special needs of embedded algorithm? Which sorting algorithm
.23

is best for embedded systems? Why? [6]


16

b) Explain Randomized and Approximate algorithms. [4]


8.2
.24

[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

iii) Here T.Length = 11 so Q = 11


0/1
CE
83

8
iv) And P mod Q = 26 mod 11 = 4

23
.23

v) Now find the exact match of P mod Q...


ic-
16

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

You might also like