MCA - Sem 2 - Design & Analysis of Algorithms
MCA - Sem 2 - Design & Analysis of Algorithms
71: i
ESE
July- 2023
Max. Marks: 100 Duration: 3.00 hrs
Class: F.Y. MCA Semester: Il
Course Code:MC507 Branch: M.C.A.
Name of the Course: Design and Analysis of Algorithms
Instruction:
(1) All questions arc compulsory
(2) Draw neat diagrams
(3) Assume suitable data if necessary
3. 4.
void function(int n) while(n>l)
( 1
int count = 0; n=n/2
for(int i=l; i<=n; i++) stmt
for(int j=l; j<=n; j++)
for(int k=i;k<=n/2;k++) }
count++;
J__________________
B) Apply quick sort algorithm on array A = (10 1 52 8 6 13 20 3 50 69 )
4 2-3
Show all (he iterations.
OR
Derive (he Best. Worst and Average time complexities of Quick sorting
technique._________
Q2 A) Consider sum of subset problem defined on the
(he following
following set
set 10 3- 4
A={1,2,3,5,7,9}. Solve the problem using backtracking technique and
4- 4
dynamic method. Analyze and compare both the methods.
i
B) Discuss the Graph coloring Problem. What technique is used to solve 10 3-3 \
the problem? Write the algorithm to solve above problem.
Q3 A Consider start state for a 15 puzzle problem as shown in table below. 10 4-3
Show three levels of branching using branch and bound states with
justification, (show the various Queues for -live node, E node, dead
node)
4 1 2 3
7" F F 6“
TT F To TT
13 T? TT
B) Write Kruskal’s algorithm for minimum spanning tree. Analyze the 10 4-4
algorithm.
OR
Find minimum Spanning Tree for following graph using Kauskal’s 4-3
algorithm.
1 10 2
50
.45
40 3
30
35
z. 25 5
55 15
20
6
ii) Write the brute force string matching algorithm and find its time 4 Self-
complexity._____________________________________________ study
B) Find the multiplication of matrices using Strassen’s algorithm. 10 3-3
A=| 3 5 | B= | 8 7|
|6 7| , | 9 5[___________________________
Q5 A Find the shortest path distance between every pair of vertices using 10 4-3
Floyd Warshall Algorithm.
ii
2
3
6 5
2
B) Find maxflow in the network, (source: S, Sink : T) 10 4-3
in