Second Semester Examination - 2008: B. Tech / MCA
Second Semester Examination - 2008: B. Tech / MCA
com
Total number of printed pages – 8 B. Tech / MCA (b) State applications for which binary tree is
BCSE 3102 / PCS 1001/PCS 1002
most suitable. Explain representation of
binary tree in linear array.
Second Semester Examination – 2008
(c) Describe ADT representation of queue
DATA STRUCTURE USING C
with commonly used functions.
indicate marks. (f) Why do you have to check the full and
empty conditions of a STACK (imple-
1. Answer the following questions : 2 ×10
mented in linear array) ?
(a) Define data structure. What do you mean
(g) Define with example Height Balance Tree.
by ADT ? Define and differentiate between
What is the worst cases height of such
linear and non-linear data structures.
tree ?
(h) What is a symbol table ? Which data 3. (a) Define linear queue. Let QUEUE be a
structure is most suitable to represent nonempty Queue implemented using
symbol table and Why ? linear array. Write a C program to delete
(i) What is path matrix of a Graph ? Discuss m elements from the QUEUE. 5
with relevent example. (b) Sketch the binary search tree resulting
(j) What is the process of topological sorting? from the insertion of the following integer
Explain how time complexity of topological keys: 39, 24, 12, 11, 43, 73, 26, 35, 29,
structure used to represent the graph. (i) Is the tree almost complete ?
2. (a) Why do you have to check the full and (ii) Is the tree a AVL ?
empty conditions of a STACK ? Write a
(iii) What is the height of the sketched
C program to perform insertion and
tree ?
deletion in STACK that implemented using
an array. 5 (iv) Write the PREORDER traversal of
the sketched tree.
(b) Write a C program to convert a singly
linked list to circular linked list. Why 4. (a) Write an algorithm that computes the
header node is used in circular list ? number of elements and sum of elements
5 in a linear linked list. 5
BCSE 3102 / PCS 1001/PCS 1002 3 P.T.O. BCSE 3102 / PCS 1001/PCS 1002 4 Contd.
bputonline.com
(b) The in-order traversal of a tree produced 6. (a) Define a Graph. What are the different
the sequence D, B, H, E, A, I, F, J, C, representations of a Graph ? Use suitable
G and the pre-order traversal of the data structures to represent the following
same tree produced A, B, D, E, H, C, F,
directed graph in memory. 5
I, J, G. Draw the binary tree. Give a
linear array representation of the above
binary tree. Define a Node structure in A B C
C, which can be used to implement a
tree. 5 D
E F
5. (a) Describe a node structure of a doubly
linked list. Write an algorithm to delete
G I
the last node of a non-empty doubly
H
linked list. 5
BCSE 3102 / PCS 1001/PCS 1002 5 P.T.O. BCSE 3102 / PCS 1001/PCS 1002 6 Contd.
bputonline.com
7. (a) Write an algorithm to perform DFS on a 8. (a) Use linked list to represent the following
graph. Find out the path from D to K polynomial
(C – D ) + ( E AF ) + F / (H + W) * A AB.
(b) Write a program in C to sort a list of
floating point numbers (stored in a linear
array) using quick sort. In quick sort, why ––––––––––
BCSE 3102 / PCS 1001/PCS 1002 7 P.T.O. BCSE 3102 / PCS 1001/PCS 1002 8 –C