Data Structures Question Paper
Data Structures Question Paper
DATA STRUCTURES
Time : Three hours
Maximum Marks : 100
Answer FIVE questions, taking ANY TWO from Group A,
ANY TWO from Group B and ALL from Group C.
All parts of a question ( a,b,etc.) should
be answered at one place.
Answer should be brief and to-the-point and be supplemented
with neat sketches. Unnecessary long answers may
result in loss of marks.
Any missing or wrong data may be assumed suitably giving
proper justification.
Figures on the right-hand side margin indicate full marks.
Group A
1. (a) Write a CJC++ function to perform linear search on n
data elements for a given key k. What are the worth
case and average case time complexities? 10
(b) Write a recursive c;c++ function to perform binary
search on n data elements for a given key k. What are
the worst case and the best case time complexities ? 10
Group B
5. (a) Write a c;c++ function to delete an element from the Group C
root of a binary search tree. 10 9. Choose the c~rrect answer for the following : 10 X 2
(b) Write a c;c++ function to delete the smallest element (i) The equivalent postfix expression corresponding to
from a binary search tree. 10 the infix expression (A- B)*(D/E) is
(a) ABDEI*-
6. (a) Write a c;c++ function to count the leaves of a binary
(b) AB- D*E/
tree. 10
(c) AB- DE/*
(b) Show the binary search tree that is obtained after (d) ABD*- E/
insertingthekey8, 11,5, 7,9,6, 10, 14, 12. Re-draw
the tree after deleting the root. I0 (ii) Suppose a queue is implemented by a circular array
QUEUE [0 .. 11]. The number of elements in the queue,
7. (a) Construct a binary search tree whose post-order if F~ONT '= 10 and REAR = 3, will be
traversal is as follows: (a) 3
5,4,9, 11, 12, 10,13,6 10 (b) 4
(c) 5
(d) 6
S'13:4FN:CP 403 (1448)
DATA STRUCTURES
Time : Three hours
Maximum Marks : I 00
Answer FIVE questions, taking ANY TWO from Group A,
ANY TWO from Group Band ALL from Group C.
Group A
1. (a) What is run time complexity of an algorithm?
Calculate t!Ie run time complexity ofbubble sort. 2 +4
(b) What· is asymptotic little 0 notation (o) ? What is big 0
notation? 2 +2
( b} Let P be a linked list. Write a 'C' function called split to (b) What do you mean by. graph traversal ? Define
create two linked lists Q and R. Q should contain all depth-first traversal (DFS) of a. graph. Write an
elements in odd positions of P and R contains the algorithm of non-recursive d~pth first traversal. 2 + 2 + 4
remaining elements. Your function should not change (c) Compare and contrast between DFS and BFS (Breadth
list P. What is the complexity of your program? 5+3 First Search}. 6
(c) What are the limitations of array data structure ? Show, 6. (a) What is hashing? Giye the characteristics of hash
with the help of an example, how the above limitations function. 2+4
can be avoided by 'linked' lists. What do you mean by
~inear list and generalized list? 2 +2 +2 (b) Name different hash functions with a brief description
and analysis. 8
3. (a) What is a circular iist? Write an aigorithm for
inserting a node at the front. 5 (c) What is collision re-solution technique in hashing?
Explain. 6
(b) Suppose you are given two polynomials. Represent the
polynomial in a suitable data structure and write a 'C' 7. (a) What are the differences between internal sorting and
function to add two polynomials. 6 external sorting ? When is a sorting technique said to
be stable ? Explain with an example. 3+2+2
(c) Writ~ a 'C' program to implement a stack using a
single array. 9 (b) Write a 'C' program of sorting a set of numbers in
descending order using selection sort. Analyse the
4. (a) Define a binary tree. What do you mean by tree algorithm complexity. 4 +2
traversal ? Write one traversal algorithm. 2 + 2 +2
(c) Show the steps of sorting the following sequence in
JYOTHIS ACADEMY, KOttayam Mob 9495951100 www.amieindia.in
JYOTHIS ACADEMY, KOttayam Mob 9495951100 www.amieindia.in
For AMIE Section
B Study Materials
Call 9495951100
www.amieindia.in