Sie sind auf Seite 1von 3

Reg. No.

M.E./M.Tech. DEGREE EXAMINATION, JANUARY 2011. First Semester

Computer Science and Engineering

(Common to Information Technology)

241102 DATA STRUCTURES AND ALGORITHMS (Regulation 2010)

PART A (10 2 = 20 marks) 1. 2. 3. Define Performance Evaluation.

The delete-min operation for Min-Max heaps and Deaps have the same asymptotic complexity O (log n ) . Which will run faster in practice? Why? How

about insert operation? (Hint: give the worst-case number of key comparisons). 4. 5. 6. Write the steps to be followed to decrease the key in node b. How will you calculate the Balance factor of an AVL tree? What is the maximum height of a bottom up splay tree that is created as the result of n insertions made into an initially empty splay tree? What is the use of Convex Hull? How is recursion used in Divide and Conquer strategy? Define Graph Coloring. List out the advantages of Dynamic Programming over greedy.

75

07
8. 9. 10.

7.

75

What are the properties of an algorithm?

07
Answer ALL questions.

Time : Three hours

75
Maximum : 100 marks

Question Paper Code :

20073

07

PART B (5 16 = 80 marks) 11. (a) (i)

Devise a linked list representation for a list in which insertions and insert and delete at either end.

(ii)

Define the concept and advantages of a DOUBLY LINKED LIST with an example. Or (6)

(b)

(i)

Write a function that inverts an arbitrary non-recursive list l with no shared sublists. The sublists of l also are inverted. (8) (8)

(ii)

Compute the failure function for each of the following patterns.

(2) (3) 12. (a) (i)

ababaa

abaabaabb a min

Consider

07
binomial heap with Or Or 2

(1)

aaaab

3,6,8,2,16,22,14,30,9,11. (ii)

75
algorithm. every insertion.

Meld the following min height biased leftist trees using the (6)

(b)

Explain, with example the basic heap operations and write algorithms for the same. (16)

13.

(a)

Insert the following elements in sequence into an initially empty 2-3 tree: 6, 3, 8, 1, 4, 5, 7, 2, 9. Delete the elements 11 and 14. Show the 2-3 tree after every insertion and deletion. (16)

07

(b)

(i)

Insert the following elements in sequence into an initially empty (10)

red-black tree : 1, 10, 2, 9, 3, 8 , 4, 7. Show the red-black tree after

75

75
following

deletions can be made at either end in 0(1) time. Write functions to

07
(10) elements. (10)

20073

(ii)

Delete the element 2 from the below shown figure (double edge red-black tree.

indicates a red pointer, single indicates a black pointer). Show the

14.

(a)

A greedy algorithm, just like an approximation algorithm, gives a nonoptimal solution to a problem. What is the difference between the two types of algorithm? Compute the time complexity of the both. Or (16)

(b)

Write a Pseudo code for Randomized Quick sort algorithm and compare its performance with iterative version of Quick sort. (16)

15.

(a)

Develop an algorithm for implementing 8 Queens Problem using BACKTRACKING method. (16)

(b)

Consider the following instance of the 0/1 knapsack problem :


n = 5 , P = (10, 15, 6, 8, 4 ) , W = (4, 6,3, 4, 2) , m = 12 .

75
Or 3

07

Give the optimal and approximate solutions for this problem. For the

75

07

solution calculate the value of (n ) .

75
(16)

07
(6)

20073

Das könnte Ihnen auch gefallen