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

MCA - Sem 2 - Design & Analysis of Algorithms

This document is an examination paper for the Design and Analysis of Algorithms course at Sardar Patel Institute of Technology, detailing questions on algorithm complexity, sorting techniques, graph problems, and dynamic programming. It includes various algorithmic problems such as quicksort, subset sum, and Kruskal's algorithm, along with instructions for students. The exam is structured to assess understanding through both theoretical and practical applications of algorithms.

Uploaded by

radhakrishn1088
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)
143 views

MCA - Sem 2 - Design & Analysis of Algorithms

This document is an examination paper for the Design and Analysis of Algorithms course at Sardar Patel Institute of Technology, detailing questions on algorithm complexity, sorting techniques, graph problems, and dynamic programming. It includes various algorithmic problems such as quicksort, subset sum, and Kruskal's algorithm, along with instructions for students. The exam is structured to assess understanding through both theoretical and practical applications of algorithms.

Uploaded by

radhakrishn1088
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/ 4

■r •' .

71: i

Sardar Patel Institute of Technology


Bhavan’s Campus, Munshi Nagar, Andheri (West), Mumbai-400058, India
%>S.X9°X
(Autonomous College Affiliated to University of Mumbai)

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

Q. No. Questions Max. CO­


Marks BL
Qi
A) Find the bounding function and complexity of following code. 16 1-3
2.
void function(int n) void function(int n)
( {
int count = 0; int count = 0;
for(int i=n/4 i<=n; i++) for(int i=0; i<n; i++)
fordnt j=l; j<=n; j=3*j) for(int j=i; j<i*i;j++)
for(int k=l;k< n; k=k*3) if (j?.i == 0)
count- (for (int k=0;k<j;k+ + )
}
printf("*");
}
)

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

Q4 A i)Compare Greedy and Dynamic programing techniques (Definition, 6 3-4


Working, Performance, Analysis, Example)

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

You might also like