DATASTRUCTUREALGORITHMS-2018 3rdsem
DATASTRUCTUREALGORITHMS-2018 3rdsem
I 9
Mlllr
m
IAUL l<^tAt/t lzao
lra\rEtarE 0f IEcltto(aol
*V+,
MAULANA ABUL KALAM AZAD UNrynnsTTy oT
TECHNoLoGY, WEST BENGAL
Paper Code : CS.302
DATA STRUCTURE AND ALGORITHM
Time Allotted: 3 Hows Fuil Martcst T0
The figures in the margin indicate full marks.
Candidates are required to give their answers in their own words
as far as practicable.
Group - A
(Multlple Cholce Type Quesdons)
t2
(a) O) 4
(c)5 (O3
(ii) In a circularly linked list organization, insertion of a node involves the modification of
(a) no pointer (b) I pointer
(c) 2 pointers (d) 3 pointers
(iii) A B-nee is
(a) always balanced (b) an ordered hee
(a) 2k $) 2k
(c) zk -t (d) None ofthese
(c) a breadth first spanning tree ofa gmph. (d) None ofthese
point
(a) Articulation (b) Sink
(viii) In a height balanced tree the heights of two sub-trees of every node never differ by more than
(a)2 O)0
(c) 1 (d) -1
(ix) Inserting a new node after a specific node in a doubly linked list requires
GrouP -B
(Short Answer Type Questions)
Answer any three of the following. 5x3=15
3. Compare and contrast linked list with static and dynamic array.
4. Write an algorithm to insert a data X immediately before a specific data item Y in a single linked list.
5. What is Load Factor? Why do we need hashing? How does a hash table allow O(1) searching? Why is a
prime number chosen for computing a hash function? 1+1+2+1=5
C S/B.Te c WC S E/IT/O tuUS EM - 3 /C S - 3 02D 0 I 8 - I 9
Insert the following keys into a B-Tree ofgiven order mentioned below:
a, f, b, k, h, m, e, s, r, c. (Order 3)
a, g, I b, k, d, h, m, j, e, s, I, r, x, c, l, n, t, u, p. (Order 5)
2+3=5
Group - C
(Long Answer Type Questions)
Answet an! three of the following. 15x.3=45
7. what are sparse matrices? How such a matrix is represented in memory? what
are the types of sparse
matrices?
Show that the function f(n) defined by
f(l) = 1
f(n) = f11p11 * l/n for n>1, has the complexity O (log n)
Let the size of the elements stored in an 8x3 matrix be 4 bytes each. If the base
address of the matrix is
3500, then find the address of A t5,21for both row major and column major
cases. 2+2+z+4+5=ls
E. (a) What do you mean by extemal sorting? How does it differ from
intemal sorting?
(b) write an algorithm for sorting a list numbers in ascending
order using selection sort technique.
(c) Describe Kruskal's minimal spanning ree algorithm.
3+7+5=15
9' What is expression tree? Draw the expression tree and write the In, Pre
& posrorder traversals for the
given expression tee: E (2x + y) (5a
= -b)3. Prove that the number of odd degree vertices in a graph is
always even. Apply BFS/DFS Algorithms and find out the path of the given graph:
2+2+l+l+1+3+5=15
C S/B.Te c h/C S E/TI/O ild/SE M - 3 /C S - 3 02 n U 8' I 9