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

be_computer-engineering_semester-4_2022_december_analysis-of-algorithmrev-2019-c-scheme

The document is an examination paper for the subject 'Analysis of Algorithm' with a total of 80 marks. It includes various questions on algorithms, including explanations of best, average, and worst case scenarios, greedy algorithms, and sorting methods. Students are required to attempt a total of four questions, with specific instructions for each question.

Uploaded by

Aman Mansuri
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

be_computer-engineering_semester-4_2022_december_analysis-of-algorithmrev-2019-c-scheme

The document is an examination paper for the subject 'Analysis of Algorithm' with a total of 80 marks. It includes various questions on algorithms, including explanations of best, average, and worst case scenarios, greedy algorithms, and sorting methods. Students are required to attempt a total of four questions, with specific instructions for each question.

Uploaded by

Aman Mansuri
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

EA

5A
8

3E
1
AD
Paper / Subject Code: 40522 / Analysis of Algorithm

A4
60
E7

CF
EA

5A
D8
50

41

3
60
35

E7

CF
AA

AA
(3 Hours) Total Marks: 80

D8
F3

50

41
7E

5
34

60
5

AA
N.B: (1) Question No. 1 is compulsory.

33

EA
7D

D8
50
(2) Attempt any three from the remaining questions.

05
34

35

E7
56

6
(3) Figures to the right indicate full marks.

EA
7D

D8
F3
39

50

5
3E

34

60
35

E7
56

AA
1. Attempt any four

7D

D8
F3
CF

39

50

E
(a) Explain Best Case, Average Case and Worst Case. (05)

3E

34

35

E7
6

AA
41

95
(b) Explain Multistage graphs. (05)

7D

F3
F

50
AA

7E
3
C
(c) Explain Binary search algorithm. (05)

3E

34

35
56
41
05

E
7D
(d) Define NP Class, NP hard, NP complete. (05)

F3
CF

39

50
AA
86

E
3E

34

35

E7
56
(e) What is greedy algorithm? (05)

41
AD

7D
0

F3
CF

39

50
A
86
EA

5A
2.

3E

34

5
56
41
D

33
7D
(a) Write and explain sum of subset algorithm for n=5, W= {2,7,8,9,15}, M=17.

60
E7

CF

39
AA

4F
5A
D8

3E
50

56
(10)

41
E

D3
60
35

E7

CF

39
AA

A
(b) Obtain the solution to the following knapsack problem using Greedy method: n=7, m=15

F
67
5A
D8
F3

3E

34
0

41
(p1,p2.....p7) = (10,5,15,7,6,18,3), (w1,w2,.....,w7) = (2,3, 5,7,1,4,1). (10) E
55

95
34

7D
60
7

CF
A

A
33

0E

E3
EA

5A
7D

D8

56
41
F

55

F3
3.
4

60
E7
56

39
A

A
3

33

1C
EA
(a) What is the Longest Common Subsequence problem? Find the LCS for following strings

5A
7D

D8
39

3E
0
F

55

A4
3E

34

(10)

60
E7
56

CF
A
33

5A
D

D8
CF

39

50
String 1- ACBAED

41
4F

7E
67
3E

60
35

A
1

AA
String 2- ABCABE
D3

0E
5
A4

EA

D8
F3
CF

(b) Explain quick sort with algorithm and example. (10)


3

05
55
67
5A

34

E7

A
1

86
3
3

95
A4

EA
D
60

F3
CF

4.
50

AD
3

67
5A
D8

3E

34

35

E7
(a)What is Knuth Morris Pratt Method of Pattern Matching? Give Examples.
1

95
A4

EA
7D
60

3
CF
AA

50
(10)
4F
3
5A
D8

35

E7
56
1
7E

(b) Solve the following Recurrence using Substitution Method. (10)


D3
F3
4
60

F3
39
AA

50
A
0E

1C

67
A
D8

3E

34

35
7E

5
55

5
4

1, if n=1
7D
60

F3
CF

39
AA

AA
33

0E

T(n) =
D8

3E

34
56
1
4F

7E

05
55

7D

2 T(n/2) + Cn, if n>1


CF

9
AA

AA
D3

86
33

0E

E3

56
41
D
4F

5.
05
55
67

F3
E7

39
AA

(a) Find the Dijkstra’s shortest path from vertex 1 to vertex 4 for the following graph.
3

86
33
95

1C
5A
7D

3E
0

D
F

E
55

A4

(10)
34

0
E7
56

CF
AA

86
33

5A
7D
39

41
D
F

7E
55
3E

34

60
56

AA

AA
33

0E
7D

D8
F

39

7E
1C

05
55
3E

34
56

86
33

0E
A4

EA
7D
F

39

AD
F
1C

55
3E

34

7
56

33

0E
4

EA
7D
F

39
AA

4F
1C

55

(b) Apply Merge sort algorithm to sort the following numbers. Show each step clearly. 10, 5,
3E

E7
56

D3
05

33
4

39

7, 6, 1, 4, 8, 3, 2, 9. (10)
50
AA
86

4F
1C

67
3E

35
AD

D3
5

5
4
60

F3
F

39
AA

6. Write notes on (any two): (20)


1C

67
D8

3E

34
5

95
4

7D
60

F
AA

AA

E3
1C
D8

56
7E

F3
4

(a) Find Minimum and Maximum elements of an array X[0 : 9] = (45, 83, 75, 17, 43, 37, 80,
60

39
AA

AA
0E

C
D8

53, 61, 22) using divide and conquer strategy.


3E
1
7E

5
55

A4
60

CF
AA

(b) Naïve string matching algorithm with example.


E

A
D8
50

41

(c) N-queen problem algorithm with example.


7E

5
60
35

AA

AA

------------------------
E

D8
F3

50

7E

05
4

15407
35

AA
D3

86
E
F3

50

AD
7E
67

35
D3

EA
F3

50
7

34

9567D34F33550E7EAAD8605AA41CF3E3
35

E7
56

You might also like