DS 2022 qb2
DS 2022 qb2
COLLEGE OF
USN
Thirdsemester B.E. Degree
ENGINEERING-BANGALORE
(Autonomous) Examinations, Mar/Apr-2022
Data Structure MVJ201S32/CD32
ration:3 Hrs.
Common to CD and ISE
Vote Maximum Marks :100
,Answer allQuestions in Part-A.
" Answer any five full questions in Part B
Choosing one full question from each module.
ONo.
Marks
PART-A
1 Howdo you initialize an array in C?
a) int ar|3] = (1,2,3): b) int ar(3) = (1,2,3)}:
c) int arr[3] = {1.2,3); d) int ar(3) = (1,2,3): 1
What is the value of the postfix
a) 1
expression 63 24+- *?
b) 40
c) 74 d) -18 1
What kind of linked list is best to answer questions like "What is the
item at
position n?"
a) Singly linked list b) Doubly linked list
c) Circular linked list d) Array implementation of linked list 1
Which of the following is the most widely used external memory data
structure?
a) AVL tree b) B-tree
c) Red-black tree d) Both AVL tree and Red-black tree
expression?
Which of the following is an infix b) ab+c*
a) (a+b)*(c+d) d) abc+* 1
c) +ab
following is done?
10 When an operand is read, which of the
a) It is placed on to the output
b) It is placed in operator stack 1
c) It is ignored d) Operator stack is emptied
increment the rear end of the queue?
11 In acircular queue, how do you
b) (rear+1) % CAPACITY
a) rear++
d) Rear- -
c) (rear % CAPACITY)+1 1
2| 5Pages
18 17 16 15
20 19
2. Q,No.
Which
a) c)
99 a)
25are In a)
3|5Pa c) a) c) a)7 The What
b) a) Connected
Tightly
Connected
Weakly c) a) Descendirng memory
more
36
a) graph A ful Consumes
memoryless is
10 binaryConsunmes
size are
elements
Wastage caStack
n be number the
g arrays.Define
on min-maxheap heapmax implemented
arraythstructures
rough an of leaf
primitiveExplain thSRol
em. INo,Writecarried lesser inodes
se having and the advantage
followng of search
Find a data
C
priority than
inserted of Queue elements
different SName, an memory in
operations program
the structures. edge the the tree
queue data of
in is in tree,every recursive
the
student DoB,
types to from allocated an if the
that can array the disadvantage how
internal
d
who andefne List each adjacency
can of be approach
data haCGPA.
s and many
be vertex implemented b) 49
d) 14
b) b)
101d) 49 d) b)
heap
tried)min b) d) node
highest Connected
Strongly
details explainModule-1 PART-BConnected
Looselyd) b) internal
structures
performed? OR Read Index of More Less
to Elerments negativecan be
sequentialy matrix has than
of the every the code code
CGPA, the of of an
using tharray?
e of nodesexactly
with data the different other can a and
has iterative
students first graph are two toeasy
for5 be
examples. vertex element there be
operations accessed having children. to
students is
writtenapproach?
weather in implement
called in 7 the If
What an vertices
and that tree?there
fields a array
are display can is
the like be
1 1 1
Marks 1 1
1
8 8
b) Give the alaorithm for Binary Search and apply the same to search th
key=92 in the array: 13, 17,23, 34,67, 76, 92, 99
Module-2
3 a) Define stack. Give the implementation of push, pop and display functione
Include check for empty and full conditions. 8
b) Outline the algorithm for infix to postfix. Using the same algorithm conven
the following infix expression to equivalent postfix expression: 8
(X+ ( Y + Z)*U)/) *W).
OR
4 a) Write an algorithm to evaluate a a postfix expression and apply the same
for the given postfix expression, 5 46+ *493+*
b) Write a C function Calnsert( ) and CODelete()operations on circular
queues.
Module-3
S a What is a linked list? Explain the different types of linked lists with neat
8
diagram.
b) Write and explain to implement the operations of stack using singly linked 8
list with the help of C statements.
OR
6 a) With the C statement explain how do you create a node, add and delete
on singly linked ist with proper message where each node is containing
8
the details of students in the formn of SRollNo, SName and CGPA as data
fields.
b) Write a Cfunction to inserta node at front and delete a node from rear
end in a circular linked list.
Module-4
3
3 7
Fig.9(c)
OR
10 a) Write an
algorithm for BFS and DFS graph traversal
b) Apply topological methods.
sorting for the graph in figure 10(b).
Fig:10(b)
5|5Pages