DAA SPPU Paper
DAA SPPU Paper
DAA SPPU Paper
8
23
P8465 [Total No. of Pages : 2
ic-
Oct-22/BE/Insem-41
tat
B.E. (Computer Engineering)
9s
1:0
DESIGN AND ANALYSIS OF ALGORITHMS
02 91
3:4
(2019 Pattern) (Semester - VII) (410241)
0
21
Time : 1 Hour]
3/1 13 [Max. Marks : 30
0
Instructions to the candidates:
0/2
.23 GP
8
3) Figures to the right indicate full marks.
C
23
4) Assume suitable data, if necessary.
ic-
16
tat
8.2
9s
Q1) a) Why correctness of the algorithm is important? Define loop invariant
.24
1:0
property and prove the correctness of finding summation of n numbers
91
49
3:4
using loop invariant property. [8]
30
OR
0/2
GP
Q2) a) How to prove that an algorithm is correct? How to prove the correctness
3/1
8
23
.23
Q3) a) What is Best, Average and Worst case Analysis of Algorithms? Analyse ic-
16
tat
the following algorithm Best, Average and Worst case [8]
8.2
9s
1:0
int i, j;
91
49
3:4
j = i-1;
21
key = a[i];
01
02
{
3/1
a[j+1] = a[j];
CE
80
j = j-1;
.23
}
a[j+1] = key;
16
}
8.2
}
.24
P.T.O.
49
b) • Explain P, NP, NP-Hard and NP-Complete problems with examples.
8
23
ic-
• Explain 3-SAT problem using an example. Why is SAT so important
tat
in theoretical computer science?
9s
[7]
1:0
OR
02 91
3:4
Q4) a) What is NP-complete class problem? How would you prove vertex cover
0
21
3/1 13
problem is NP-complete class problem? [8]
b) What is Best, Average and Worst case Analysis of Algorithms? Analyse
0
0/2
.23 GP
8
C
23
int i;
ic-
for (i = 0; i < n; i++) {
16
tat
if (a[i] = = item) {
8.2
9s
.24
return a[i]
1:0
91
49
3:4
}
30
21
}
01
02
return - 1
0/2
GP
3/1
CE
80
8
23
.23
ic-
16
tat
8.2
9s
.24
1:0
91
49
3:4
30
21
01
02
0/2
GP
3/1
CE
80
.23
16
8.2
.24
Oct-22/BE/Insem-41 2
49