CSE-Computer-Engg-Data-Structures
CSE-Computer-Engg-Data-Structures
P. Pages : 3 AT - 2159
Time : Tbree Hours iliililililIil Mirx. lr{arks r 80
Notes I Answer three question from Section A and three question from Scction B.
2 Assume suitable data wherever necessary.
3 Illustrate your ans*Er necessar], with the help of rcat sketches.
4 Use cf pen Blue,tslack inl/refill only for writing thc aoswer book.
b) For each olthe following pattems P and texts T, find the numbcr C ofcomparisons to find 6
INDEX of P in T using'slo\ / algorithm.
i) P=aaa 1= laabb)l
ii) P: abc 1= 1ab)5
iii) P=aaba T = abaababb
OR
a) Suppose T is thc text "THE STUDENT IS II-L". Lse appropriate slrtax to change T so
that it rcads :
b) Consider the pattem P : aba2b. CoDstruct the table & the conesponding labeled directed t!
graph used in second patl€m matching algorithm.
1 a) What is Stackl W te an algorithm to push & pop element from stack assunring array 6
rcPrcsentation of a stack.
b) Consider the lbllowing infix expession Q. Translato Q into cquivalent postfix expressioo 8
P.
0 (A + Ir)*D) 1(E -F)
ii) (A B)i((D+E)'r)
OR
8 a) \\'hat is Queue? \l'ritc an algorithm for insertion & deicrion ofclement from queue 6
assuming linked list representalion.
b) What is one way and tlvo way iuorder flreaded binary hee? Draw the same for given 7
binary tree. Also draw Two-\r'ay threaded tree with header node.
B
\c
DE GH
FJK
./
L
OR
10. a) A Binary tree T has some nodes. lhe inorder & prcordcr traversal of T ycilds following e
scquence of nodes. Dra\l' Trec.
lnorder : Q B K C F A C P E D II R
Prcorder : GB Q ACKF PD E R H
AT.2159 2
b) Suppose the following list oflette$ is iruerted in order into an empty binary search tree : 7
J, R. D, G, T, E, M, H, P, A. F, Q.
i) Find the final hee T ard
i;) find thc ircrder traversal ofT.
iii) Find the new tree afl.I node M is deleted.
iv) Now delele node D.
S r
x Z
Y
i) Find the adjacency maftix A ofgaph G.
ii) Find the path matrix P of G.
iii) ls the graph strongly connccted?
AT - 2159