You are on page 1of 4

M.E/M.

Tech DEGREE EXAMINATION, NOVEMBER/DECEMBER 2010 First Semester Computer Science and Engineering CS9212- DATA STRUCTURES AND ALGORITHM (Common to M.Tech - Information Technology) (Regulation 2009) Time: Three hours Maximum: 100 Marks Answer all the questions Part A (10 x 2 = 20 Marks)
1. What is algorithm complexity? What is the need of measuring the

complexity of an algorithm?
2. Mention a storage structure for storing a symmetric matrix of order m

x n efficiently with the time complexity of access operations. 3. Does the sequence <23, 17, 14, 6, 13, 10, 1, 5, 7, 12> represents a heap? 4. Compare the skewed heaps and heaps. 5. How is the rotation free deletion of a node having both sub trees, done in an AVL search tree? 6. Distinguish between 2-3 trees and 2-4 trees. 7. How does one decide whether to use or not divide and conquer method for a problem? 8. Give the time complexity for Strassens matrix multiplication algorithm for dense matrices.

9. Enumerate any two applications for Graph coloring algorithm.


10. Consider the knapsack problem with W= 12 and the following

(weight, value) pairs of items: (6, 25), (2, 8), (5, 19), (7, 26), (3, 10), (4, 10), (1, 1). Find the maximum achievable value.

PART B (5 x 16 = 80 Marks) 11. (a) Explain the following class of algorithm with an example. (i) (ii) (iii)
(iv)

NP- Hard NP- completeness Exponential time algorithm Cubic time algorithm. Or (16)

(b) Explain Insertion and deletion algorithm for circular Multiply doubly linked list with head nodes. (16)

12. (a) Discuss an algorithm to find the nth smallest value from a Max

heap and Binary Search tree. Compare. Or

(16)

(b) Discuss, compare and construct Binomial heaps and Fibonacci heaps in terms of insertion, deletion operations and applications. (16)

13. (a) Describe any one scheme for implementing Red-Black Trees.

Explain Insertion and Deletion algorithm with details. How do these algorithms balance the height of the tree? Or (b) Explain the data structure, Insertion, deletion operations and application for Tries. (16) (16)

14. (a) The classical Towers of Hanoi problem begins with a stack of n>=1 disks on one of three pegs. No two discs are of the same size, and the discs are stacked in order, with the largest on the bottom. Solving the problem requires moving the stack from peg A to peg B in such a way that only one disc is moved at a time and no disc can be placed on top of a disc smaller than itself. The Cyclic Towers of Hanoi problem adds the following constraint: The pegs are placed at the vertices of a triangle and discs can only be moved to the adjacent peg in the cycle order. Thus a single move can transfer a disk from A to B, from B to C, or from C to A. All other moves are illegal.
(i)

Write a pseudo code procedure for solving the Cyclic Towers of Hanoi.

(ii)

Find the time complexity of your algorithm.

(16)

Or (b) (i) Discuss the quick sort algorithm with its complexity. (8)

(ii) With illustration, explain tree vertex splitting algorithm. (8)

15. (a) Distinguish the solutions for Eight queens problem using dynamic

programming and backtracking. Or

(16)

(b) Two character strings may have many common substrings. For example, photograph and tomography have several common substrings of length one, and common substrings of ph and to of length two, and ograph of length six, which is also the maximum common substring. Let X=x1xx..xn and Y=y1yx..yn be two character strings. Design a dynamic programming algorithm to find the maximum common substring length for X and Y. Apply your algorithm to X = photograph and Y = tomography show detailed steps. What is the complexity of your algorithm? (16)

You might also like