0% found this document useful (0 votes)
44 views2 pages

Be - Computer Engineering - Semester 4 - 2023 - May - Analysis of Algorithmrev 2019 C Scheme

This document appears to be an exam paper for the analysis of algorithms. It contains information about the structure of the exam such as the total marks, duration, and instructions for answering questions. Question 1 is compulsory and students must attempt 3 of the remaining questions.

Uploaded by

whereisnike43
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)
44 views2 pages

Be - Computer Engineering - Semester 4 - 2023 - May - Analysis of Algorithmrev 2019 C Scheme

This document appears to be an exam paper for the analysis of algorithms. It contains information about the structure of the exam such as the total marks, duration, and instructions for answering questions. Question 1 is compulsory and students must attempt 3 of the remaining questions.

Uploaded by

whereisnike43
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/ 2

B

AC

7
E4

3E

87
49
Paper / Subject Code: 38972 / Analysis of Algorithm

D9
B9

29

C8
02

E4

3E
79

7
49

9A

88
BF

B9

29
02

ED

AC
E4
79
B6

49

93

D9
BF

B9
02
B1

42
(Time: 3 Hours) Total Marks: 80

3E
79
B6

49
83

9E
BF

29
02
B1
5D

9B

E4

3E
79
B6
83
77

24
BF

B9

29
B1
5D
N.B: (1) Question No. 1 is compulsory.

88

90

E4
B6

49
AC

83
77

F7
(2) Attempt any three from the remaining questions.

B9
02
B1
5D
88

6B
D9

79

49
AC

83
77

1B
(3) Figures to the right indicate full marks.

3E

BF

02
5D
88
D9

3B
29

79
B6

9
AC

77

24
E4

3E

D8

BF
B1
88

90
D9
B9

29

75

B6
1. Attempt any four

AC

83

F7
E4

3E

87
49

B1
5D

6B
D9
B9

29

C8
02

(A) Describe the relationship along P, NP, NP-hard, NP-complete? 5

83
77

1B
E4

3E
79

49

9A

5D
88
(B) What is the difference between divide and conquer approach and dynamic

3B
BF

B9

29
02

ED

6
AC

77

1B
E4
79

D8
B6

programming? 49 5

93

88
D9

3B
BF

B9
02

75
B1

42

AC
3E
79

D8
B6

87
49
(C) Explain Multistage graph with example. 5
83

9E

D9
BF

29

C8
02

75
B1
5D

9B
(D) Write an abstract algorithm for greedy design method. 5

E4

3E
79
B6

87
9A
83
77

24
BF

B9

29

C8
B1
5D

ED
88

90
(E) What is Asymptotic analysis and define big Oh, big Omega and Theta notation? 5

E4
B6

49

9A
AC

83
77

F7

93
B9
02
B1
5D

ED
88

6B

42
D9

79

49
AC

83
77

9E

93
1B
3E

BF
2. (A) Sort the following numbers using Quick Sort. Also, derive the time complexity of Quick

02
5D
88

9B

42
D9

3B
29

79
B6
AC

77

9E
24
E4

Sort. 50, 31, 71, 38, 77, 81, 12, 33. 10


3E

D8

BF
B1
88

9B
90
D9
B9

29

75

B6
AC

83

(B) What is Knuth Morris Pratt Method of Pattern Matching? Give Examples. F7 10

24
E4

3E

87
49

B1
5D

6B

90
D9
B9

29

C8
02

83
77

F7
1B
E4

3E
79

49

9A

5D
88

6B
3B
BF

B9

29
02

3. (A) Solve the following instance of Job sequencing with deadlines problem n=7, profits (p1,
ED

AC

77

1B
E4
79

D8
B6

49

93

88

p2, p3, p4, p5, p6, p7) = (3, 5, 20, 18, 1, 6, 30) and deadlines (d1, d2, d3, d4, d5, d6, d7) =
D9

3B
BF

B9
02

75
B1

42

AC
3E
79

D8
B6

87
49
83

9E

(1, 3, 4, 3, 2, 1, 2). Schedule the jobs in such way so as to get maximum profit. 10
D9
BF

29

C8
02

75
B1
5D

9B

E4

3E
79
B6

87
9A

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

24
BF

B9

29

C8
B1
5D

ED
90

E4
B6

49

9A
83
77

F7

93
B9
02
B1
5D

ED
88

6B

42

4. (A) Find Longest Common Subsequence for following strings 10


79

49
AC

83
77

9E

93
1B

BF

02
5D
88

X = acbaed
9B

42
D9

3B

79
B6
AC

77

9E
24
D8

BF

Y = abcabe
B1
88

9B
90
D9

75

B6
AC

83

F7

24
3E

(B) Write an algorithm to find the minimum and maximum value using divide and conquer
87

B1
5D

6B

90
D9
29

C8

83
77

and also derive its complexity. 10


F7
1B
E4

3E

9A

5D
88

6B
3B
B9

29

ED

AC

77

1B
E4

D8
93

88
D9

3B
B9

75
42

AC
3E

D8
87
49

9E

D9
29

C8
02

75
9B

E4

3E
79

87
9A
24
BF

B9

29

C8
ED
90

E4
49

9A
F7

93
B9
02

ED
6B

42
79

49

9E

93
1B

BF

02

28902 Page 1 of 2
9B

42
3B

79
B6

9E
24
D8

BF
B1

9B
90
B6
83

F7

24

5D83B1B6BF790249B9E4293ED9AC8877
B1
5D

6B

90
D8 BF B9 D9 5D
3B 79 E4 AC 83
1B 02 29 88 B1
5D 6B 49 3E 77 B6
F7 B9 D9 5D
83 90 E4 AC 83
BF
B1 24 29 88 B1 79
B6 9B 3E 77 02
BF 9E D9 5D B6 49
79 AC BF B9
B1 02 42 83 79 E4
B6 49 93 88 B1 02 29
BF B9 ED 77 B6 49 3E

28902
79 E4 9A 5D BF B9 D9
02 29 C8 83 79 E4 AC
49 3E 87 B1 02 29 88
6B B9 D9 75 B6 49 3E 77
F7 E4 AC D8 BF B9 D9 5D
90 29 3B 79 E4 AC 83
24 3E 88 1B 02 29 88 B1
9B 77 49 3E
programming.

9E D9 5D 6B B9 D9 77 B6
90 42 AC 83 F7 5D

6. Attempt any two


E4 AC BF
24 93 88 B1 90 29 83 79
9B ED 77 B6 24 3E 88 B1 02
9E 9A 5D BF 9B D9 77 B6 49
42 C8 83 79 9E AC 5D BF B9
93 87 B1 02 42 83 79 E4
ED 75 B6 49 93 88 B1 02 29
9A D8 BF B9 ED 77 B6 49 3E
79 E4 9A 5D BF B9 D9
C8 3B 02 29 C8 83 79 E4 AC
87 1B 49 3E 87 B1 02 29
75 6B B9 75 B6 49 3E 88
D8 F7 E4
D9
D8 BF B9 D9 77
3B 90 AC 79 E4 5D
1B 24 29 88 3B 02 29
AC 83
6B 9B 3E 77 1B 49 3E 88 B1
F7 9E D9 5D 6B B9 D9 77 B6
90 42 AC 83 F7 E4 AC 5D BF

Page 2 of 2
24 93 88 B1 90 29 83 79
24 88 B1

------------------
9B ED 77 B6 9B 3E 77 02
9E 9A 5D BF B6 49
42 C8 83 79 9E D9
AC 5D BF B
93 87 B1 02 42 83 79
ED 75 B6 49 93 88 B1 02

5D83B1B6BF790249B9E4293ED9AC8877
ED 77 B6 49
(A) Explain naïve string matching algorithm with example.

9A D8 BF B9
9A 5D BF B9
C8 3B 79 E4 83 79 E4
87 1B 02 29 C8 B1 02 2
(B) Explain 0/1 knapsack problem using dynamic programming.

75 6B 49 3E 87 B6 49
D8 B9 D9 75
Paper / Subject Code: 38972 / Analysis of Algorithm

3B F7 E4 AC D8 BF B9
1B 90 29 3B 79 E4
24 3E 88 1B 02 29
6B 9B D9 77 6B 49 3E
F7 9E 5D B9
(C) To Find MST of following graph using prim’s and kruskal’s Algorithm.
5. (A) Find a minimum cost path from 3 to 2 in the given graph using dynamic

90 42 AC 83 F7 E4
24 93 88 B1 90 29
9B ED 77 24
(B) Write an algorithm to solve N Queens problem. Show its working for N = 4.

5D B6 9B 3E
9E 9A BF 9E D9
42 C8 83 79 42 AC
93 87 B1 02 93
ED 75 B6 49 ED
9A D8 BF B9
20
10

9A
10

C8 3B 79 E4
87 1B 02 29 C8
75 49 3E 87
D8 6B
F7 B9 D9 7
3B 90 E4 AC
1B 24 29 88
6 9 3E 7

You might also like