DS 2022 qb
DS 2022 qb
USN
Degree
GINE RING-BANGALMVJO2R01S32/E CD32
(Autonomous) Examinations, Marl Apr-2022.
Data Structure
Common to CD and ISE
ration:
3 Hrs
Answerall
Questions in Part-A. Maximum Marks:100
" Answerany five full questions in Part B
choosing one full question from each
module.
Marks
PART-A
Howdoyouinitialize
an array in C?
(1,2,3):
a) int ar|3]= (1,2,3): b) int arr(3) = (1,2,3}:
int arr[3] =
c)
d) int arr(3) = (1,2,3): 1
value of the postfix expression 6324+ -*?
What isthe
a) 1 b) 40
d) -18 1
c) 74
What is the functionality
of thee following piece of code?
public int function()
1\5P ages
on a binary tree can build the tree
pair's traversals
6 Which of the following post-order and in-order
uniquely? b)
a) post-order and pre-order
d) level order and preorder 1
c post-order and level order
which node?
with the greatest key is always in
7 In amax-heap,
element node of left sub tree
b) First right sub tree 1
a) Leaf node d) First node of
c) root node
list?
circular linked list from a normal linked circular
8 What differentiates a b) It is faster to traverse the
a) Youcannot have the 'next' linked list
pointer point tonull ina
circular linked list in circular
d) Head node is known
C Youmay or may not have the linked list
next' pointer point to null in a 1
circular linked list
expression?
Which of the following is an infix ab+c*
a) (a+b)*(c+d) b)
abc+* 1
c) +ab
12 Convert the following infix expressions into its equivalent postfix expressions.
(A + BAD)/(E - F)+G
a) (A BDA+EF-/G+) b) (A BD +A EF-/G+)
c) (ABDA+EF/-G+) d) (A BDEF+A/ -G+)
13 What is an AVL tree?
a) a tree which is balanced and b) a tree which is unbalanced and isa
is a height balanced tree height balanced tree
c) tree with three children d) a tree with atmost 3 childrerm
14 Where is linear searching used?
a) When the list has only a few
elements b) When perfoming a single search u
c) an unordered list
Used all the time
d) When the list has only a
few
elements and When performing a
single search in an unordered list
2 1 Q.No. 20 19 18 16 15
Connected
Connected
WeaklyTightly c)heap
max a) c) a) c)
36 c)
90a)25
are In c al
types a) d) c) a)graph A Descending Which al7 The What is
itiveExplain hem.
SRollNo, Wnte carriedDefionne min-maxheap SIZeelements
implementthroeughd an ck
are Wastage arraystructurescaStn abe
of number 10 binarhuly,
having lesser leaf
ConsumCo
ens u
me
m e
ms l
oer
sy the
Find and the of nodes
aC data pronty of following search advantage,
different
ions SName. arrays. an than
inserted Queue elements e
e
thprogram memory in more
structures. edge queue the internal
the treetre
student in data is than ofi
memory recursive
DoB. from allocated the in tree.every
that to an if the
and List can
who define each array the disadvantage many
how
can of be adjacency
hasCGPA, and approach
data
be vertex implemented 49
d) 101d)
d) b) b) 14
b) 49
b) node d) b)
d)
details explainModule-1 PART-BConnected
Loosely
med? highest Connected
Strongly
d) b) internal
OR Read
Index More Less
structures to trie heapmin Elerments
sequentially negativecanbe of matrix of
of the has
CGPA. the of the every code code
of exactly iterat1vean
using the array? nodes
data the different other can a has and
with first having
graph 7
students
for be children
are two If toeasy
examples. vertex elerment there
the in be
5operations accessed to
writtenapproach?
students
weather is implement
called in
an vertices
What and that tree?there
fields a array
are display can is
the like be
1 1
Marks 1 1
1 1
8
the same tO search
and apply
Binary Search76, 92, 99
b) Give the algorithm foor
13, 17,23, 34, 67,
key=92in the array: Module-2
and display functions. 8
pop
implementation of push,
the convert
3 a) Defne stack. Giveempty and full conditions. the same algorithm
Include check for infix to postfix.Using expression:
algorithm for equivalent postfix
Outline the to
O) following infix expression
the
/V) * W).
((X+ (( Y+Z)*U) OR
and apply the
same
expression 8
algorithm evaluate a a postfix
toexpression,546+ 493/+*
4 a Wnte an * operations on circular
given postfix CQDelete( 8
TOT the and
function COlnsert( )
b Wite a C
queues. Module-3
lists with neat
different types of linked
is a linked list? Exolain the
5 a What linked
diagram. operations of stack using singly 8
implement the
b) Write and explain to statements.
list with the help of C
OR delete
do you create a node, add and
explain how containing
6 a) With the C statement proper message where each node is
with as data
on singly linked list the form of SRolINo, SName and CGPA
the details of students in
fields. rear
insert a node at front and delete a node from 8
b) Write a C function to
end in a circular linked list.
Module-4
define:
7 a) What is a tree? With suitable example 8
i) Binary tree ii) Level of binary tree
ii) complete binary tree iv) degree of a tree
b) Define expression tree. For a tree given in figure 7(b) traverse the tree
using in-order preorder and post-order traversals. Write the algorithm for
the same
Fig-7(b)
4|5Pages M VI201S3
OR
Whatis an AVL
tree? Explain the different types of
a Construct abinary search tree by
using the
rotations of an AVL tree.
8 preorder traversals following in-order and
b In-order: BCAEDGHEI
Preorder: ABCDEFGHI
Module-5
al Define graph. Explain the adjacency matrix and list representation of a
araph with example.
Definethe terminologies
Graph
with example for
graph data structure.
() Directed Acyclic
(i) Complete graph
Prim's algorithm, determine minimum cost spanning tree for the
c) Apply 9(c).
weighted graph in figure
1
7
3 2
Fig9(c)
OR
and DFS graph traversal methods.
10 a) Write an algorithm for BFS
for the graph in figure 10(b).
b) Apply topological sorting
Fig.10(b)
MVI201S3 2
55Pages