MCS-031 june 2012

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

No.

of Printed Pages : 4 MCS-031

MCA (Revised)
Term-End Examination
June, 2012
N
CO
C.) MCS-031 : DESIGN AND ANALYSIS OF
ALGORITHM

Time : 3 hours Maximum Marks : 100


Note : Question No. 1 is compulsory. Attempt any three from
the remaining questions.

1. (a) Write Euclid's algorithm for finding Greatest 4


Common Divisor (G.C.D) of two natural
numbers m and n.
(b) Let fact (n) =1 * 2 * 3 * n where '*' 4
denotes product of two integers and n is a
natural number. Give a recursive definition
of fact (n).

(c) Name at least four well-known techniques 2


for solving problems algorithmically.
(d) For the function f(x) = 3x3 + 2x2 + 1, show 2
that f(x) = 0(x3) where '0' denotes 'big oh'.
(e) Explain how binary search method finds or 4
fails to find the number 25 in the sorted
list : 8, 12, 26, 35, 48, 57.

MCS-031 1 P.T.O.
(f) Explain how the nodes of the following the 4
graph will be traced using breadth first
search, starting at node 'a':

(g) Explain the method of pre-order traversal 4


of a tree, using a suitable example of a tree,
with at least eight nodes.
(h) Using Principle of Mathematical Induction, 4
show that sum of first n natural numbers is
n (n +1)/2.
(i) Explain the essential idea of Dynamic 4
Programming. How does Dynamic
Programming differ from Divide and
Conquer approach for solving problems ?
(j) Using selection sort, sort the following 4
sequence of numbers, in the increasing
order :
15, 12, 18, 24, 13, 27,
(k) Name four undecidable problems, along 4
with their special significance.

MCS-031 2
(a) Write an algorithm that finds the real roots, 5
if any, of a quadratic equation :
ax2 +bx +c =0,
Where a # 0, b and c are real numbers.
(b) Explain Chomsky classification for 5
grammers, with an appropriate example.
(c) Write a recursive algorithm to find the sum 5
of first n natural numbers.
(d) Sort the following list using Merge Sort : 5
7, 9, 10, 8, 4, 6, 5.

3. (a) Find solution of the recurrence equation, 5


given as follows :
F(n) — 4F(n —1) + 4F(n — 2) = 0
(b) Trace how Depth First Search Traverses the 7
following tree, when starting at node B :

(c) Explain each of the following, with an 8


appropriate example :
(i) Minimax Problem
(ii) Topological Sort

MCS-031 3 P.T.O.
4. (a) Find the value of (12)31, using not more than 6
SIX (6) multiplications and/or divisions.
(b) Using either Prim's algorithm or Kruskal's 8
algorithm, find a minimal spanning tree for
the graph given as follows :

(c) Explain the meaning of each of the 6


following expression :
(i) (a + b)*
(ii) a* b a* b a*
(iii) (a + b)* a b
Where denotes Kleene Closure.
5. (a) Find a grammer for the following language : 8
ambn; m, nEN, n > m }
(b) Explain each of the following problems, 12
together with their respective significance.
(i) Halting Problem
(ii) Post Correspondence Problem
(iii) Undecidable Problem

MCS-031 4

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy