Sie sind auf Seite 1von 2

Code No: 55101/MT

NR
M.Tech. – I Semester Supplementary Examinations,
September, 2008

DESIGN AND ANALYSIS OF ALGORITHMS


(Common to Computer Science & Engineering/
Computer Science)

Time: 3hours Max. Marks:60

Answer any FIVE questions


All questions carry equal marks
---

1.a) Explain the general method of divide and conquer.


b) Write Merge sort algorithm using links.
c) Estimate the time-complexity of the above algorithm.

2.a) Write union and Find algorithms that use weighting rule and
collapsing rule respectively for disjoint sets.
b) Using the above representation for disjoint sets, write an algorithm for
job sequencing with dead lines.

3.a) Write and explain Prim’s Algorithm to generate a minimum cost


spanning tree.
b) Estimate the time complexity of the above algorithm.

4.a) Write a non recursive procedure for the post order traversal of a given
binary tree.
b) Define a B-tree of order m.
c) Compare the performance of the following search trees for insertion,
deletion and searching operations:
i) AVL trees
ii) B-trees.

5.a) Write an algorithm for finding the minimum cost binary search tree.
b) Using the above algorithm compute w(i,j), r(i,j) and c(i,j), 0≤i≤j≤4, for
the identifier set (a1, a2, a3, a4)=(cout , float, if, while) with
( )
p (1) = 1
20 ( ) ( ) ( )
, p (2) = 1 , p (3) = 1 , p (4) = 1
5 10 20
,

( ) 5 ( ) 10 ( ) ( )
5 ( )
q (0) = 1 , q (1) = 1 , q (2) 1 , q (3) = 1
20
, q (4) = 1
20
.
Using the r(i, j)’s construct the optimal binary search tree.

Contd…2.,
Code No: 55101/MT ::2::

6.a) Write a backtracking algorithm to find all the Hamiltonian cycles of a


graph.
b) Determine the order of magnitude of the worst-case computing time
for the backtracking procedure that finds all Hamiltonian cycles.

7.a) Write a C++ program that overloads + and suitable relational


operators (<, > etc) to perform the following operations on two strings:
i) Concatenation
ii) Comparison.
b) Write a C++ program that demonstrates how exceptions are handled.

8. Write notes on the following: -


a) Amortized analysis
b) Principle of optimality for Travelling Salesman Problem.
c) Non-deterministic Algorithms.

x-x-x

Das könnte Ihnen auch gefallen