Professional Documents
Culture Documents
No:
B.E/B.Tech DEGREE EXAMINATION ,November-2009
Second Year-Third Semester
IT 2201 -DATA STRUCTURES AND ALGORITHMS
Model Question Paper-I
(Information Technology)
(Regulation 2008)
Time:Three hours
Maximum:100 marks
PART A(10x2=20 marks)
1.
2.
3.
4.
5.
6.
7.
8.
Write down the definition of data structures? 2. Give few examples for data structures?
State any 2 applications of stack and queue
What is an expression tree?
What are the two methods of binary tree implementation?
What is linear probing?
What do you mean by disjoint set?
Define (i)indegree (ii)outdegree
Write down the adjacency matrix of the graph
RMKCET\MQ_Paper\III Sem\Nov 09
Page 1
12 a i) Show that the maximum number of nodes in a binary tree of height h is 2(h+1) -1 (4)
ii) Define traversal. What are the various traversal that are permitted for a binary tree? Write
down their recursive algorithm and apply to the following example given.(12)
A
D
F
(or)
12 b i ) Do the following insertions with the explanation of rotation involved in each insertion in AVL
tree --insert K ,insert M ,insert U,insert T,insert V, insert P(8)
ii) Construct an expression tree for the following expression abc*+de*f+g*+(8)
13a i) Write notes on open addressing and chaining. (8)
ii) Explain in detail about rehashing and extendible hashing? (8)
(or)
13 b ) Construct the hash table with the table size of 13 for the following values 39,48,61,74,87,100,113.
Implement using open addressing and separate chaining with appropriate algorithms. (16)
14 a ) Write down the algorithms for a depth first search and breadth first search and apply to the
following example given. (16)
A
(or)
14 b) Formulate an algorithm to find the shortest path using Dijkstras algorithm. (16)
15 a i) Explain pruning in detail. (8)
ii) What is NP hard and NP complete problem. (8)
(or)
RMKCET\MQ_Paper\III Sem\Nov 09
Page 2
15 b i) Write the time complexity to perform binary search in an unsorted array of n numbers.(8)
ii)Define the following notations(8)
a)big oh(O)
b)small oh(o)
c)theta()
d)omega()
Reg.No:
B.E/B.Tech DEGREE EXAMINATION ,November-2009
Second Year-Third Semester
IT 2201 -DATA STRUCTURES AND ALGORITHMS
Model Question Paper-II
(Information Technology)
(Regulation 2008)
Time:Three hours
1.
2.
3.
4.
5.
Maximum:100 marks
PART A(10x2=20 marks)
Why is linked list used for polynomial arithmetic.
Write the role of stack in function call.
What is collision. How do you overcome collision?
Give a simple hash function when the input keys are integers?
Is the following tree an avl tree? Justify your answer
RMKCET\MQ_Paper\III Sem\Nov 09
Page 3
11a) What is Stack ADT? Give any one implementation of stack and explain clearly the data
structures and the routines used. (16)
(or)
11b) Discuss the Doubly linked list and algorithm for the operations that can be performed on
them in detail. (16)
12a i) Explain in detail the various types of tree traversals. (10)
ii) Discuss about the sequential and other representation of trees. (6)
(or)
12b i) construct a heap for the initial key set given the list 42, 23, 74, 11, 65, 58, 94, 36, 99 and
87. (8)
ii) Give one implementation of a priority queue and explain the routines used. (8)
13a i) Explain in detail the linear probing techniques. (8)
ii) Write a pseudo algorithm for find and union operations. (8)
(or)
13b) Explain the smart union and path compression method with the help of suitable examples.
(16)
14a ) Write a routine to find a shortest path between two given vertices in a weighted directed
graph. Use it to find the shortest path between A and F in the graph of question 14 b) (16)
(or)
14b ) Write a routine to find a minimum spanning tree of a weighted directed graph. Use it to
find the MST of the following graph.(16)
5
A
6
C
6
1
2
3
15 a ) How Divide and conquer strategy is applicable to Binary Search. Explain (16)
(or)
RMKCET\MQ_Paper\III Sem\Nov 09
Page 4
Maximum:100 marks
PART A(10x2=20 marks)
Page 5
ii) Write the procedures to implement single and double rotations while inserting nodes in an
AVL tree. (10)
13a) Given input {4371,1323,6173,4199,4344,9679,1989} and a hash
function
h(X)=X(mod10), show the resulting:
(a) Separate chaining table (4)
(b) Open addressing hash table using linear probing (4)
(c) Open addressing hash table using quadratic probing (4)
(d) Open addressing hash table with second hash function h2(X) =7-(X mod
7). (4)
(or)
13b) How will you resolve the collisions while inserting elements into the hash table using
separate chaining and linear probing? Write the routines for inserting, searching and removing
elements from the hash table using the above mentioned techniques.
14a i) Discuss and write the program to perform topological sorting. (6)
ii) What is single source shortest path problem? Discuss Dijkstras single source shortest
path algorithm with an example. (10)
(or)
14 b i) Write an algorithm to find the minimum cost spanning tree of an undirected, weighted
graph. (8)
ii) Find MST for the following graph.
A
2
1
8
B
1
3
4
E
RMKCET\MQ_Paper\III Sem\Nov 09
Page 6