No.
of Printed Pages : 6 MCS–211
MASTER OF COMPUTER
IG
APPLICATIONS
N OU
(MCA–NEW)
Term-End Examination
As
December, 2024
si
g nm
MCS-211 : DESIGN AND ANALYSIS OF
ALGORITHMS
en
Time : 3 Hours Maximum Marks : 100
tG
Weightage : 70%
ur
Note : (i) Question No. 1 is compulsory.
u.
(ii) Attempt any three questions from the
co
rest.
m
1. (a) Write Euclid’s algorithm to find the GCD of
two natural numbers m and n. 5
D–3025/MCS–211 P. T. O.
[2] MCS–211
(b) Arrange the following growth rates in
increasing order : 5
O(n2 ), O(2n ), O (n log n), O (2 !),
IG
O (1), O (log n)
N
(c) Give a recessive function to find the height
OU
of a binary tree. What is the running time
As
of this algorithm ? 5
si
(d) Compute x 283 by using left-to-right binary
g
exponentiation. 5
nm
(e) Write binary search algorithm and
en
evaluate its time complexity in the best
and worst case. 5
tG
(f) Find the topological ordering of the
ur
following graph : 5
u.
co
m
D–3025/MCS–211
[3] MCS–211
(g) For the following given letter and their
frequencies, construct the Huffman tree : 5
Ci fi
IG
a 65
N
b 3
OU
c 4
d 10
As
e 3
si
f 6
g
(h) What are the disadvantages of using
nm
Dijkstra’s algorithm ? List out any four. 5
en
2. (a) Define a BFS tree. Give the breath first
traversal for the undirected graph given
tG
below, starting from vertex ‘a’ : 10
ur
u.
co
m
Also give any three applications of DFS.
D–3025/MCS–211 P. T. O.
[4] MCS–211
(b) Write Bubble Sort Algorithm. Using bubble
sort sort the following sequence :
20, 15, 25, 10, 8, 38, 27, 11
IG
N
Find the total number of comparisons
OU
required by the bubble sort algorithm in
As
sorting the list. 10
si
3. (a) Write Merge Sort Algorithm. Apply the
g
same to sort the array of elements : 10
nm
7, 15, 5, 9, 20, 18, 25, 17, 11
en
(b) Explain how dynamic programming can be
tG
used to solve matrix chain multiplication.
ur
Apply the algorithm to multiply the
u.
following : 10
co
(M1 ,M2 ,M3 ,M4 ) with dimensions
m
(15 × 6, 6 × 50, 50 × 9, 9 × 12)
D–3025/MCS–211
[5] MCS–211
4. (a) Write Dijkstra’s algorithm. Using
Dijkstra’s algorithm, find the minimum
distances of all the nodes from starting
IG
node ‘a’ : 10
NOU
As
si
g nm
en
(b) Solve the following fractional Knapsack
tG
problem using Greedy algorithm : 10
ur
Number of objects = 7
u.
Capacity of Knapsack = 5
co
Weight of objects, Wi = (2, 3, 5, 7, 1, 4, 1)
m
Profit of objects Pi = (10, 5, 15, 7, 6, 18, 3)
D–3025/MCS–211 P. T. O.
[6] MCS–211
5. (a) Apply Floyd Warshall algorithm on the
following graph : 10
IG
NOU
As
Show the matrix D2 of the graph.
si
g
(b) A binomial coefficient is defined by the
nm
following recurrence relation :
C (n, 0) = 1 and C (n, n) = 1 for n > 0
en
C (n, k) = C (n – 1, k) + C (n – 1, k – 1)
tG
for n > k > 0
(i) Write a recursive function to generate
ur
C (n, k). 4
u.
(ii) Give an algorithm based on dynamic
co
programming to solve C (n, k). 6
m
Compare the time requirements to solve
algorithm.
×××××××
D–3025/MCS–211
Download other previous papers from www.ignoubaba.com
No. of Printed Pages : 5 MCS-211
MASTER OF COMPUTER
APPLICATION
(MCA–NEW)
Term-End Examination
June, 2024
MCS–211 : DESIGN AND ANALYSIS OF
ALGORITHMS
Time : 3 Hours Maximum Marks : 100
Weightate : 70%
Note : Question No. 1 is compulsory. Attempt any
three questions from the rest.
1. (a) Use mathematical induction to prove that :
5
n
n(n 1) (2n 1)
i2 6
i 1
(b) Write recursive binary search algorithms
and analyse its complexity in worst case
scenario. 5
(c) What is an algorithm ? Explain
characteristics of an algorithm with the
help of an example. 5
P. T. O.
Download other previous papers from www.ignoubaba.com
[2] MCS-211
(d) Multiply the following two matrix using
Strassen’s algorithm : 5
5 6 – 7 6
– 4 3 and 5 9
(e) What are P and NP class of problems ?
Differentiate between NP-Hard and NP-
Complete problems. 5
(f) Explain quick sort algorithm using
suitable example. 5
(g) Multiply the following two numbers using
Karatsuba’s algorithm. 5
(h) What is string matching algorithm ?
Derive its best case time complexity. 5
2. (a) What is Minimum Spanning Tree ? Write
Prim’s algorithm for finding Minimum
Spanning Tree and find its time
complexity. Also find MST of the following
graph using Prim’s algorithm : 10
Download other previous papers from www.ignoubaba.com
[3] MCS-211
(b) Write an algorithm for topological sort.
Obtain a topological ordering for the
following graph : 10
3. (a) “The best-case analysis is not as important
as the worst-case analysis of an algorithm.”
Yes or No. Justify your answer with the
help of an example. 10
(b) Sort the following sequence of numbers,
using selection sort. Also find the number
of comparisons and copy operations
required by the algorithm is sorting this
list : 10
28, 13, 12, 28, 35, 11, 15, 9, 36
P. T. O.
Download other previous papers from www.ignoubaba.com
[4] MCS-211
4. (a) Explain the 0/1 Knapsack problem. Solve
the following 0/1 Knapsack problem : 10
Given number of objects n = 6
Capacity of Knapsack (M) = 12
(P1, P2, P3, P4, P5, P6) = (1, 6, 18, 22, 28, 43)
and (W1, W2, W3, W4, W5, W6) = (1, 2, 5, 6,
7, 10), where Pi’s and Wi’s are the profit
and weights of the corresponding objects.
(b) Give a divide and conquer based algorithm
to find the ith smallest element in an array
of size n : 10
Trace your algorithm to find 3rd smallest
in the array :
A = (10, 2, 5, 15, 50, 6, 20, 25)
5. (a) Write Dijkstra’s algorithm to find the
shortest path in a graph. Apply Dijkstra’s
algorithm on the following graph : 10
Download other previous papers from www.ignoubaba.com
[5] MCS-211
(b) Apply Floyd Warshall Algorithm (FWA) to
find the shortest path distance between
every pair of vertices in the following
directed weighted on graph : 10
Also, find the time complexity of an
algorithm.
MCS–211
P. T. O.
Download other previous papers from www.ignoubaba.com
No. of Printed Pages : 4 MCS–211
MASTER OF COMPUTER
APPLICATIONS
(MCA-NEW)
Term-End Examination
December, 2023
MCS-211 : DESIGN AND ANALYSIS OF
ALGORITHMS
Time : 3 Hours Maximum Marks : 100
(Weightage : 70%)
Note : Question No. 1 is compulsory and carries
40 marks. Attempt any three questions from
the rest.
1. (a) What is Euclid’s algorithm to find GCD of
two given integers ? Write the steps
involved in finding GCD of (a, b) using
Euclid’s algorithm. 5
(b) What are Big ‘O’ and Big ‘’ notations ?
Explain with the help of representative
diagram. 5
P. T. O.
Download other previous papers from www.ignoubaba.com
[2] MCS–211
(c) Write and explain linear search
algorithm. Mention best case, worst case
and average case scenarios of linear
search. 5
(d) Explain Breadth First Search (BFS)
algorithm with a suitable example. 5
(e) What is Task Scheduling algorithm ? Write
pseudo code for task scheduling algorithm.
5
(f) Solve the given recurrence relation using
recursion tree method : 5
n
n 2T n
2
(g) What are P, NP and NP-complete
problems ? Give example of each. 5
(h) What is a Minimum Cost Spanning Tree
(MCST) ? Write Generic MCST algorithm.
5
2. (a) What are the building blocks of an
algorithm ? Explain how to judge an
algorithm, whether it is efficient or not ? 6
(b) Using mathematical induction, prove that
the sum of first ‘n’ positive integers is
n n 1
i.e. 1 + 2 + 3 ............ + n
2
n n 1
= . 6
2
Download other previous papers from www.ignoubaba.com
[3] MCS–211
(c) What is polynomial evaluation ? What are
its methods of evaluation ? Evaluate
P x 3x 2 5x 6 using Horner’s rule at
x = 3. 2+2+4
3. (a) What is Greedy approach for problem
solving ? How does a Greedy algorithm
work ? Write the activities performed in
Greedy method. 6
(b) Explain merge sort algorithm using divide
and conquer approach. Also mention its
best case and worst case time complexities.
6+2
(c) Explain any three of the following terms
with the help of a suitable diagram : 3×2=6
(i) Subgraph
(ii) Connected graph
(iii) Adjacency matrix
(iv) Directed acyclic graph
4. (a) Show the step by step execution of
Dijkstra’s single source shortest path
P. T. O.
Download other previous papers from www.ignoubaba.com
[4] MCS–211
algorithm on the given directed graph from
source vertex ‘a’ : 6
(b) What is string matching problem ? Explain
Knuth Morris Pratt algorithm of string
matching with a suitable example. Explain
the process of building LPS array for a
pattern ‘P’. 2+4+2
(c) What is all pair shortest path problem ?
Write and explain Floyd Warshall
algorithm for shortest paths with the help
of a diagram. 6
5. Write short notes on any four of the following :
4×5=20
(i) Tractable vs. Intractable problems
(ii) CNF Satisfiability problem
(iii) Optimization and decision problems
(iv) Prim’s algorithm
(v) Approximation algorithms
(vi) Master’s theorem
MCS–211
No. of Printed Pages : 4 MCS-211
MASTER OF COMPUTER
APPLICATIONS
(MCA-NEW)
Term-End Examination
June, 2023
MCS-211 : DESIGN AND ANALYSIS OF
ALGORITHMS
Time : 3 Hours Maximum Marks : 100
(Weightage : 70%)
Note : Question No. 1 is compulsory and carries
40 marks. Attempt any three questions from
the rest.
1. (a) What is an algorithm ? What are its
desirable characteristics ? 5
(b) What are asymptotic notations ? Explain
any two asymptotic notations with suitable
example for each. 5
(c) Solve the following recurrence relation
using substitution method : 5
n
T n 2T n
2
P. T. O.
[2] MCS-211
(d) Write and explain binary search algorithm
with an suitable example. 5
(e) Explain Depth First Search (DFS)
algorithm with an suitable example. 5
(f) What is Dynamic Programming approach
of problem solving ? Write the steps
involved in dynamic programming. 6
(g) What are Optimization and Decision
problems ? Give an example of each. 5
(h) Design a state space tree for the given
subset sum problem. S = {4, 6, 7, 8}, W = 8.
4
2. (a) Explain all the three cases of Master’s
Theorem. Apply Master’s theorem to solve
the given recurrence relation : 8
n
T n 9T
3
(b) Evaluate :
p x 3x 4 2x 3 5x 7 at x 2
using Horner’s rule. Show stepwise
iterations. 6
(c) Prove that for all non-negative integers
‘n’ : 6
20 21 22 .......2n 2n 1 1.
[3] MCS-211
3. (a) What is Huffman coding ? Write the steps
for building the Huffman tree with an
example. 6
(b) Explain Quick sort algorithm using divide
and conquer approach. 6
(c) What are strongly connected components ?
Explain how adjacency matrix and
adjacency list are created for a connected
graph with the help of a suitable diagram.
2+3+3
4. (a) Show the step by step execution of
Kruskal’s algorithm for the following
graph : 6
(b) What is Matrix chain multiplication
problem ? Find an optimal parenthesiza-
tion of a martix-chain product whose
sequence of dimensions are as follows : 2+6
Matrix Dimension
A1 30 × 35
A2 35 × 15
A3 15 × 5
P. T. O.
[4] MCS-211
(c) Explain Rabin Karp Algorithm for string
matching with suitable example. 6
5. Write short notes on any four of the following :
4×5=20
(i) Deterministic vs. Non-deterministic
algorithms
(ii) CLIQUE and vertex cover problem
(iii) Backtracking problem with example
(iv) Bellman-Ford algorithm
(v) Fractional Knapsack problem
MCS–211
No. of Printed Pages : 4 MCS-211
MASTER IN COMPUTER APPLICATIONS
(MCA-NEW)
Term-End Examination
December, 2022
MCS-211 : DESIGN AND ANALYSIS OF
ALGORITHMS
Time : 3 hours Maximum Marks : 100
(Weightage : 70%)
Note : Question no. 1 is compulsory. Attempt any
three questions from the rest.
1. (a) Write a mathematical definition of big
omega (). For the functions defined by
f(n) = 3n3 + 2n2 + 1 and g(n) = 2n2 + 3,
verify that f(n) = (g(n)). 6
(b) Explain the principle of optimality in
dynamic programming, with the help of an
example. 6
(c) Apply a master method to give the tight
asymptotic bounds of the following
recurrences : 8
(i) T(n) = 4T (n/2) + n2
(ii) T(n) = 9T (n/3) + n
MCS-211 1 P.T.O.
(d) Run the Prim’s algorithm on the following
graph. Assume that the root vertex is a .
Derive the complexity of the algorithm. 10
(e) Apply Huffman’s algorithm to construct a
Huffman’s tree and optimal binary prefix
code for the letters and its frequencies as
given in the following table : 10
Letter Frequency
A 15
B 6
C 7
D 5
E 12
I 13
Z 2
2. (a) Explain Cook-Levin’s theorem on
CNF-Safisfiability problem, with the help of
an example. 10
MCS-211 2
(b) (i) Apply Dijkstra’s single source
shortest path algorithm to the
following graph with a as starting
vertex. Show all the intermediate
steps. 7
(ii) What is the significant feature of
Bellman-Ford’s algorithm which is not
supported in Dijkstra’s algorithm ? 3
3. (a) Write and explain pseudocode for
Ford-Fulkerson’s algorithm for maximum
bipartite matching. 10
(b) Apply the partition procedure of Quicksort
algorithm to the following array :
[35, 10, 40, 5, 60, 25, 45, 15]
Show all the intermediate steps. 10
4. (a) Apply DFS to the complete graph on four
vertices. List the vertices in the order they
would be visited. 7
(b) How many comparisons are needed for a
binary search in a set of 512 elements ? 3
MCS-211 3 P.T.O.
(c) Apply Floyd-Warshall’s algorithm to the
following graph and show D2. 10
5. (a) Describe the task scheduling algorithm as
an optimization problem and calculate its
complexity. Consider the following jobs and
its service times and apply the task
scheduling algorithm to minimize the total
amount of time spent in the system. 10
Job Service time
1 10
2 15
3 8
4 12
5 6
(b) Describe the basic principle of KMP
algorithm for string matching. What is its
advantage compared to Naive and
Rabin-Karp’s algorithm for string
matching ? Calculate the time complexity of
KMP algorithm. 10
MCS-211 4
No. of Printed Pages : 5 MCS-211
MASTER IN COMPUTER APPLICATIONS
(MCA-NEW)
Term-End Examination
December, 2021
MCS-211 : DESIGN AND ANALYSIS OF
ALGORITHMS
Time : 3 hours Maximum Marks : 100
(Weightage : 70%)
Note : Question no. 1 is compulsory. Attempt any three
questions from the rest.
1. (a) Write a mathematical definition of
O (big oh). Assume that the function
f(n) = 2n2 + 3n + 1. Show that f(n) = O(n2). 5
(b) Define a recurrence relation of QuickSort
algorithm and solve it using a recurrence
tree. 10
(c) What are the key features of combinatorial
problems ? Describe and formulate three
combinatorial problems. 10
MCS-211 1 P.T.O.
(d) Describe a task scheduling problem as an
optimization problem. Apply the
scheduling algorithm with deadlines to
maximize the total profit to the following
problem : 10
Jobs Deadlines Profits
1 2 60
2 3 50
3 4 70
4 5 80
5 4 75
6 3 55
7 2 40
(e) List all the different orders in which we
can multiply five matrices M1, M2, M3,
M4, M5. 5
2. (a) Explain the naïve string matching
algorithm and derive its worst case
complexity. What is its drawback ? What
will be the maximum valid shifts of a
pattern in the text in the following
example ? 10
Text : a b c x y z d e f g h
Pattern : f g h
MCS-211 2
(b) What is the similarity between Dijkstra’s
single source shortest path and Prim’s
minimum cost spanning tree algorithms ?
Apply Dijkstra’s algorithm to find the
shortest path from v1 to all other vertices of
the following graph : 10
3. (a) Apply Horner’s method for evaluating a
polynomial expression
p(x) = 6x6 + 5x5 + 4x4 – 3x3 + 8x – 7
at x = 3.
Calculate : 10
(i) How many times will the loop execute ?
(ii) What will be the total number of
multiplication and addition
operations ?
(b) Define a fractional knapsack problem as an
optimization problem. Write a greedy
method to find an optimal solution to the
problem. Show the complexity of the
algorithm. 10
MCS-211 3 P.T.O.
4. (a) Apply the DFS algorithm to the following
graph with the starting vertex v1. List the
order in which vertices will be visited.
Show the complexity analysis if a graph is
represented through
(i) Adjacency list, and
(ii) Adjacency matrix. 10
(b) Explain P, NP and NP-complete class of
problems with appropriate examples of
each class. 10
5. (a) Apply Floyd Warshall’s algorithm and show
the matrix D2 of the following graph : 10
MCS-211 4
(b) Explain the use of master method. Write
and interpret all the three cases of the
master method to solve recurrence relation
problem. 10
MCS-211 5 P.T.O.