DSPM (3rd) Dec2014
DSPM (3rd) Dec2014
of Pages: 02
Total No. of Questions: 09
B. Tech.(CSE, IT) (Sem.-3rd)
DATA STRUCTURES & PRG. METHODOLOGY
Subject Code: CS-207
Paper ID: [A0454]
Time: 3 Hrs. Max. Marks: 60
INSTRUCTIONS TO CANDIDATE:
1. Section –A, is Compulsory.
2. Attempt any four questions from Section-B.
3. Attempt any two questions from Section-C.
o m (10x2=20)
.r c
(a) What is base address of an array? How can you print base address of an array on the screen?
(b) What are linear and non- linear data structures? Give example.
p e
(c) Discuss one real life application where stack data structures is useful.
(d) How can we determine if end of string has been reached?
p a
(e) Give two advantages of Hashing.
(f)
r
What is the difference between a graph and tree?
b o m
.
(g) In which scenario do we prefer to read input directly from a file?
(h) What is a header node? Why is it significant?
(i)
w
Give one advantage and one limitation of using recursion. .r c
w (j) What is (i) degree of a vertex (ii) connected component
p e
w a
Section –B
r p (4x5=20)
Q. 2.
.b
How linked lists are represented in the memory? Write an algorithm to insert new node at
the beginning of a two way linked list.
Q. 3.
w
(a) Convert the given infix expression to its prefix form with proper explanation:
(a+b*c/d) + (e+f^g)/(c+d)
w
Q. 4.
recursive. How? w
(b) Give two examples of recursive functions? Can we convert a recursive function to non-
What are priority queues? Write an algorithm to illustrate insertion and deletion in circular
queue
Q. 5. What are sequential files? Explain how the file open and file close functions are performed
in C.
Q. 6. Write a C program that reads a sentence and prints frequency of each of the vowels and
total count of consonants.
Page: 1
M-56504
Section –C (2x10=20)
Q. 8. Sketch the binary search tree resulting from the insertion of following integers keys:
42, 24, 13, 11, 43, 76, 26, 35, 29, 12, 5
i. Is the tree almost complete?
ii. Is the tree AVL?
iii.
iv.
o m
What is the height of the sketched tree?
Write the pre-order and post order traversal of tree?
Q. 9.
.r c
Write a short note on Sets? Write the algorithm/pseudo-code of various operations that can
be performed on sets. Also discuss two applications where we prefer to use sets.
p e -----END-----
p a
b r o m
w . .r c
w p e
w a
r p
.b
w w
w
Page: 2
M-56504