MCS-031 june 2012
MCS-031 june 2012
MCS-031 june 2012
MCA (Revised)
Term-End Examination
June, 2012
N
CO
C.) MCS-031 : DESIGN AND ANALYSIS OF
ALGORITHM
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':
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.
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 :
MCS-031 4