Col- Sol
[This question paper contains 4 printed pages. |
Sr.No. of Question Paper : 2046 Gea
Unique Paper Code 32341301
Name of the Paper + Dats Structures
Name of the Course: :B.Se. (H) Computer Sc. CBCS
Semester 2H
Duration | 3 Hours Maximum Marks: 75
Instructio tes.
1, Write your Rell No. on the top immediately on the reccipt of this question paper,
2. Question I is compulsory.
3. Attempt any four questions out of the remaining Q2-Q7.
4. Parts of a question must be answered together.
1. (a) Give template class definition for a doubly linked list-of integers. Write a
member function to insert a node at the end of this linked list. (3)
(b) Consider the following Queue of characters af size 6: 8)
Ly«TeieL [)
Tt £
ey
This Queue is implemented as a circular array. Show the contents of the
Queue with the positions of Front and Rear after each of the following
‘operations :
( F is added to the Queue
PTO,
DA i i a2046
°
YD «
oO
uv
(4)
te)
©
i)
Gi) Twa letters are deleted
(on) K, Land M are added
(av) Three levers are deleted
tw) S is added
‘Write a recursive function for Linear Search on an array of integers. The
function should return the index of the element i it is found else it should
return -1 (s)
E
if the fallowing postfix expression | (5)
BA+CD-*CB-AD-+/ where, B=3, A=9, C=8, Ded
‘Show the contents of the stack at every step.
Construct a binary search trce for the following keys in the given order :
7s 10 44 48 98 MOB Ot 145
Show :
f Inorder Traversal
(i) Postonder Traversal
(il) The tree after deleting key 98. Use delction by merging.
(241414125)
Define a class to implement a Diagonal matrix as a 1-D array, Write the
member functions to store and retrieve its etements 6)
‘What is a hashing function ? Explain the Division Method.
Insert the keys 28, 37. 55. 72, 63, 89 into a hash table of size m=7 using:
linear probing with hash function as the Division Method. (141435)
a2046 3
2. (i). Give the formula and calculate the address af the clement A{2J[4J of the 2D
array defined as =
int A [6] [6), if the elements are stored in :
(@) raw major order
() column major order
‘The beginning address of the array is 100. Every element requires 4
bytes of storage, @
Col-S ol
(b) Let a and b be positive integers, Suppose a function F is defimed recursively
as follows :
F(t) = f ifa