0% found this document useful (0 votes)
144 views4 pages

CS 902

1. The document contains a question paper for a data structures and algorithms exam. It has two sections - Section A contains short answer questions and Section B contains longer answer questions. 2. Section A asks students to answer 5 out of 8 questions related to concepts like stacks, trees, graphs and their representations. Section B asks students to answer 5 out of 6 questions involving programming problems on recursion, linked lists, hashing, trees and graphs. 3. The paper tests students on fundamental data structures concepts as well as their ability to write algorithms and programs to implement these concepts.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
144 views4 pages

CS 902

1. The document contains a question paper for a data structures and algorithms exam. It has two sections - Section A contains short answer questions and Section B contains longer answer questions. 2. Section A asks students to answer 5 out of 8 questions related to concepts like stacks, trees, graphs and their representations. Section B asks students to answer 5 out of 6 questions involving programming problems on recursion, linked lists, hashing, trees and graphs. 3. The paper tests students on fundamental data structures concepts as well as their ability to write algorithms and programs to implement these concepts.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Name :

htt
Roll No. : ..
Invigilators Signature : ..
CS/M.TECH (CSE)/SEM-1/CS-902/2009-10
p:/
2009
DATA STRUCTURE AND ALGORITHM
Time Allotted : 3 Hours Full Marks : 70
/q
The figures in the margin indicate full marks.
Candidates are required to give their answers in their own words as
pap
far as practicable.

GROUP A
1. Answer any five questions from the following : 5 2 = 10
er.

a) The following sequence of operations are performed on


a stack :

PUSH (10), PUSH (20), POP, PUSH (10), PUSH (20),


wb

POP, POP, POP, PUSH (20), POP.

Write down the sequence of values popped out. 2

b) Convert the following infix expression into prefix and


postfix form : 2
ut .

P $ Q R S + T/U/( V + W )

c) Draw the expression tree of the following equation : 2


a c.

x = ( b + ( b $ 2 4 a c ) $ 05 ) / ( 2 a )

d) Define strictly binary tree and give one example. 2

e) Find the total number of nodes present in a complete


binary tree of depth d. 2
in

200047 [ Turn over


CS/M.TECH (CSE)/SEM-1/CS-902/2009-10

f) Find the adjacency matrix of the following graph and


identify source and sink ( if any ) of the graph : 2
htt
dia
p:/
/q

g) Can you reverse n elements of a queue using another


pap
queue ? Justify your answer. 2
h) Find the degrees of each node of the following graph
and convert the graph into a complete graph. 2
er.

dia
wb

GROUP B
ut .

Answer any five questions. 5 12 = 60


2. a) Write a program to obtain the sum of the first ten terms
of the following series using recursion : 5
a c.

x x 3 / 3 ! + x 5 / 5 ! x 7 / 7 ! + x 9 / 9 !
b) Explain tail recursion with an example. 4
c) Discuss the main disadvantages of recursion compared
in

to iteration method. 3

200047 2
CS/M.TECH (CSE)/SEM-1/CS-902/2009-10

3. a) What is dequeue ? 2
htt
b) Write the functions of a dequeue implemented by linked
list. 4
c) Let X = ( x1x2xn ) and Y = ( y 1y2y m )

be two linked lists. Write an algorithm to merge the two


p:/
lists together to obtain the linked list
Z = ( x1y1x2y2xmymxm+1xn)

if m n and
/q
Z = ( x1y1x2y2xnynyn+1ym)

if m> n. No additional nodes may be used. 6


pap
4. a) What is hashing ? 2
b) Write a program to prepare to prepare the hash table
using division method. Elements are obtained from
user. 5
c) What is the unique feature of hashing ? 2
er.

d) Discuss two ways of tackling hash collision. 3


5. a) Define minimum spanning tree. 2
b) Draw minimum cost spanning tree for the graph given
wb

below and also find its cost. ( Show the steps ) 6

dia
ut .
a c.

c) Write Prims algorithm. 4


in

200047 3 [ Turn over


CS/M.TECH (CSE)/SEM-1/CS-902/2009-10

6. a) Construct a minheap through stepwise inclusion of the


items given below : 5
htt
50, 35, 90, 23, 10, 55, 46, 79, 69, 41.
b) Sort the heap in ascending order. 4
c) Find the time complexity of heap sort. 3
p:/
7. a) Using Floyds algorithm find the shortest distance
between the nodes of the graph given below :
/q

dia
pap
er.

Write all the paths between all possible pair of nodes.


8
wb

b) Write Cooks theorem and discuss the significance of


the theorem. 4
8. Answer any two of the following : 26
a) NP-Hard and NP-Complete problems
ut .

b) B tree and B+ tree comparison


c) AVL tree balancing.
a c.
in

200047 4

You might also like