0% found this document useful (0 votes)
11 views4 pages

CSE-Computer-Engg-Data-Structures

The document outlines an examination paper for a Data Structures course, detailing the structure of the exam, including sections and types of questions. It includes various topics such as string operations, multidimensional arrays, sparse matrices, linked lists, stacks, queues, binary trees, and sorting algorithms. The exam requires students to answer specific questions, demonstrate algorithms, and illustrate concepts with sketches.

Uploaded by

Shruti Dhanvij
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views4 pages

CSE-Computer-Engg-Data-Structures

The document outlines an examination paper for a Data Structures course, detailing the structure of the exam, including sections and types of questions. It includes various topics such as string operations, multidimensional arrays, sparse matrices, linked lists, stacks, queues, binary trees, and sorting algorithms. The exam requires students to answer specific questions, demonstrate algorithms, and illustrate concepts with sketches.

Uploaded by

Shruti Dhanvij
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

ts.E.

Iounh Semester (Cornputer Science & Engineering, Computer Engineering) (CGS)


10311 : Data Structures : 4KS01 / 4KD0l

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.

I a) Explain following string operations. 1


D SUBSTRING ii) INDEX
t11) tt iv) t,FNGTH

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 :

i) 'THE STUDEN'I iS NOT ILL'.


ii) ,TIIE STUDENT IS ILL BIJT PRESENT',
iii) 'THE STUDENT IS ILL TODAY'.

b) Consider the pattem P : aba2b. CoDstruct the table & the conesponding labeled directed t!
graph used in second patl€m matching algorithm.

3 a) Suppose multidimensioml arrays A and B are declared :


A(-2:2,7:22) and B (l:8, -5:5, -10:5)
i) Find length of each dimension & the number of elements in A & B.
ii) Consider the elcment 8[3,3,3] in B ard find the effective indices Er, Ez, E: and
address ofthe element assuming Base (B) = 400 and there arc w--4 words per
mcmory location *'hen row major order representation.

b) Explai! the concepl oI spaNe matrices. Also explain its repr€sentatiol 4


OR
.l a) wdte algorithE oflinear anay A. 1
i) Inserting into array A. ii) Tmversing anay A.

b) Following is a list ofentdes, with level oumbcrs in a studenls record 6


1 Student 2 Number 2 Name
I Last 3 Fist 3 MI (Middle Initial)
2 Gender 2 Birthday 3 Day 3 Month
3 Year 2 SAT 3 Math 4 Verbal
i) Draw conespondiflg hierarchical structure.
ii) Which of the items are elementary items'/

.^^'I - 2159 I P,T.O


5 a) Write an algorithm INSLOC (Nf-O, LDIK, START, AVAIL. LOC. ITEM) to insert 1
ITEM so that llEM follo$s the node Bith location LOC or inscns ITEM as the firsr node
when LOC - ]\LILL.

b) Consider the following polynomial 1


P(x, y, z) = 312y22 - 6 y zB + 3x'1 yz + 2xy1 z - 5x2 y3 - 4*y7 z3
i) Rewite the polynomial so that the terms are ordered.
ii) Suppose the terms ale stored in the linear array COEF, XEXP. YEXP and ZEXP,
with the HEAD node first. Assigr values to link so that linked lisr contains the
ordered sequence of terms.
OR
6. a) What is linked list? Write aproccdure rvhich removes the fir$ elemeDt ofthe list and add
it to the end of the list without changing any value in INITO.

b) Desqibe the algorithm for searching a linked list.


i) For unsorted list. ii)
For sorted lisr.

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) Suppose A is following list of l2 numbers. 8


44, ll,
I l, 55. 77, 90, 40, 60, 99, 22, 88, 66.
Usjng quick sort algorithm orange it in ascending order- Show all the steps.

9 a) Let E denotc the following algebric expression. 6


D:[a + (b - c)]* [(d -e)l(r+g -n)]
i) Draw Bimr.v Tree.
ii) Find out preorde! & postorder traversal oftree

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.

11. a) Writc an aigorithm for depth hrst search of graph 6

b) Suppose 9 cards ale punched as follo$'s : 7


348, 143, 361, 423, 538, t28,321, s43,366
Given to a card sorter. Apply Radix sort ro son the numbers in thtrec phases. What is the
complexity ofRadix sort algorithm.
OR
12. a) Consider the graph G where nodes are stored in an aray DA'[A as follows : 6
DATA : X, Y, Z, S, 1
fie graph is as follows :

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?

b) Assume that an array A cotrtain the follorving elements : 7


A:77,33,44,1l, 88, 22, 66, 55
Apply seleclion sort algorithm to arrange this in ascending order. Show all the passes and
resulls.

AT - 2159

You might also like