0% found this document useful (0 votes)
109 views4 pages

Design and Analysis of Algorithms Exam

This document is the question paper for the MCA (Revised) Term-End Examination in Design and Analysis of Algorithms. It contains 5 questions testing knowledge of algorithms and their analysis. Question 1 has 4 parts testing growth rates, dynamic programming vs greedy approaches, recursive functions, and properties of Kleene star and context-free languages. Later questions cover topics like ambiguity in context-free grammars, minimum spanning trees, Strassen's matrix multiplication algorithm, regular grammars and finite automata, the 0-1 knapsack problem, Dijkstra's algorithm, analysis of sorting algorithms, randomization in quicksort, amortized analysis, and big O and big Theta notations.

Uploaded by

Sunny Kumar
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)
109 views4 pages

Design and Analysis of Algorithms Exam

This document is the question paper for the MCA (Revised) Term-End Examination in Design and Analysis of Algorithms. It contains 5 questions testing knowledge of algorithms and their analysis. Question 1 has 4 parts testing growth rates, dynamic programming vs greedy approaches, recursive functions, and properties of Kleene star and context-free languages. Later questions cover topics like ambiguity in context-free grammars, minimum spanning trees, Strassen's matrix multiplication algorithm, regular grammars and finite automata, the 0-1 knapsack problem, Dijkstra's algorithm, analysis of sorting algorithms, randomization in quicksort, amortized analysis, and big O and big Theta notations.

Uploaded by

Sunny Kumar
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

No.

of Printed Pages : 4
MCA (Revised)
lc)
Term-End Examination
December, 2012
N14
V)
MCS-031

MCS-031 : DESIGN AND ANALYSIS OF
ALGORITHMS
Time : 3 hours Maximum Marks : 100
Note : Question No.1 is compulsory. Attempt any three from
the rest of questions.
1. (a) (i) Prove that function f (x) = 5x4 + 7x +3
is 0 (x4). Is f (x) also 0 (x4) ? Explain.
5+2=7

(ii) Arrange the following growth rates in

3
increasing order of time :
0(x3), 0(2x), 0(x2), 0(,5 log x),
0(x log x), 0(x2 log x)
(b) (i) Differentiate between dynamic 5
programming and greedy approach
to solve different problems.

(ii) Write a recursive function to multiply

5
two natural numbers.
(c) (i)

Define a Kleene Star (*) of a language

7
L. Prove that if L is context free then
L* is also context free.
MCS-031 1 P.T.O.
(ii) Explain the difference between Push
3
Down Automata (PDA) and Finite
Automata (FA).
(d) (i)
Define 'Halting Problem" of Turing
Machines.
(ii) Show stepwise sorting of elements
using Heapsort algorithm to the
following max heap.
2. (a) (i) Define ambiguity in Context-Free 4
Grammar (CFG). Show that the
grammar :
E--->E+E/E*E/a is ambiguous.

(ii) If L1 and L2 are two Context-Free 3


languages, then show that L1.L2 is also
Context - Free language.
MCS-031 2
(b)
Use Prim's algorithm to construct a
8
minimum spanning tree from the following
graph (by using starting node A).
(c)
Write a short note on NP-hard problems.

5
3.
(a) Explain the complete steps of Strassen's 10
algorithm for multiplying two (n x n)
matrices.
Show that the Running time of Strassen's
Algorithm is 0 (n2.81).
(b) Build regular grammar and corresponding 10
finite automata (FA) for the following
languages over the alphabet {a, b}.
(i)
Language in which words do not end
with ab.
(ii)
Language having even number of a's.
MCS-031 3 P.T.O.
4. (a) Describe 0-1 Knapsack problem. Which 7
approach among greedy algorithm or
dynamic programming is applicable for this
problem ?
(b) Write a Dijkstra's algorithm for single source 10
shortest path problem. Apply Dikstra's
Algorithm for the following graph :
(c) What is the best case, average case and
3
worst case running time of merge sort ?
5. (a) (i) Explain the purpose of randomization 4
of quicksort.

(ii) What is the best case running time of 4


quicksort ? In which situation does it
occur ?
(b) Why do we perform amortized analysis of 5
a problem ?
(c)
Define 0 notation and 0 notation. Explain, 7
how these two notations are different.
MCS-031 4

You might also like