0% found this document useful (0 votes)
92 views

Cs Sem2

This document contains instructions for a question paper for a Data Structures exam. It includes 20 marks worth of questions across two sections. Section A contains 8 compulsory short answer questions on topics like insertion sort, binary heaps, arrays vs linked lists, Fibonacci numbers, binary search trees, deque operations, and height-balanced trees. Section B contains 2 long answer questions worth 15 marks each.

Uploaded by

refosol512
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)
92 views

Cs Sem2

This document contains instructions for a question paper for a Data Structures exam. It includes 20 marks worth of questions across two sections. Section A contains 8 compulsory short answer questions on topics like insertion sort, binary heaps, arrays vs linked lists, Fibonacci numbers, binary search trees, deque operations, and height-balanced trees. Section B contains 2 long answer questions worth 15 marks each.

Uploaded by

refosol512
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/ 8

[This question paper contains 4 printed pages.

]
Your Roll NorwLL2023
Sr. No. of Question Paper : 1268 F

[This question paper contains 8 printed pages.]


Your Roll NoluLY2023
Sr. No. of Question Paper : 1263 F

Unique Paper Code : 2342571201

Name of the Paper : Data Structures

Name of the Course B.Sc. (Programme) and B.A.


(Programme)

Year of Admission : 2019 & onwards

Semester : II

Duration: 3 Hours Maximum Marks : 90

Instructions for Candidates

1. Write your Roll No. on the togimediately oneipt


of this question paper.
LBRARY

2. Section A is compulsory.

3. Attempt any four questions from Section B.

4. Parts of the question must be answered together.


1263 2

SECTION A

1. (a) Perform the insertion sort on the array {8,2,1,9,3).


show the steps after each iteration. Also, report
the number of comparisons. (4)

(b) Explain the properties of a binary heap. How is it


different from a binary search tree. (4)

(c) Differentiate between the following : (4)


(1) Arrays and Linked list
(ii) Queue and Priority que

(c) Consider a function f() to compute Fibonacci


numbers as defined below : (4)

0if n=0
1 if n=1

Fib(n)
Fib(n-1)+Fib(n-2) if n>=2
How many tÉmes will f() be called when n=4 ?

(d) Draw a binary search tree using the following key


values; 16, 7, 23, 22, 14, 15 (4)
1263 3

(e) What are the different operations that can be


performed on a Dequeue. Explain using an
example. (4)

() What are height-balanced trees? Explain using


suitable example. (3)

(g) 'Stacks play a role in the implementation of


recursion'. Justify the statement using a suitable
example. (3)

SECTION B

2.. Consider the following Binary Search Tree. (15)

H
W

Show the status of the tree after each of


the following
operations :
J,
4. 3. 1263

Consider(a) (c) (b) (a)


ormed
list : on
an Recursion. C++ What
aoperationWrite
from Write
(v) (iv) (iii) (ii) (i)
a
for isresultant
doubly
linked
list.
program
a Finally,
tree.
the Give Is Delete valucK'Draw
Writeresultant
trcc. trce. .
the program
on
computingBinary the
a justification
resultant the the
following stack delete node
in
in Recursion? pr-order trcc
nitially C++ Fibonacci 4
using C++ the tree with after
to node for
sequence delete linked for a traversal
empty height-balanced value inscrtion
performing numbersWrite with your
a
doubly given list. a valueanswer. of 'H'
of the of
program
via node
from
operat
linkeu
ions element a Binary
'M'
tree?
resultant
push from the with
(6) (4) (5) (6) in
(a) J.
(b) (c) (b)
1263
using Give circular
linked
list. list? Whatthe is array
Illustrate between What
example.
suitable nodes, Show
a the Explain A
uitable
asymptotic = is head the
{6,0,2,0,1,3,4,6,1,3,2} the Stack an contents
Deletenode(2)
DeleteBeginning),
InsertEnd(2),
InsertEnd(7),
InsertBeginning(5),
advantage
different and InsertBeginning(10),
ample. operation abstract
and tail
analysis of
operations usingof Queue after the
5
of data
for each list,
counting-sort with type?
the 2172551201
circular
linked
a a
Big-O
performed on
the
operation. links
Differentiate between
notation help
on
(5) (6) of
(5) the (4) the
a
6. 1263

(a) (c)
answers.
your it For qucuc,and Write
is
1 i) i) acach
binary any
of two
search the
real-life
10
12
followíng
trec 6
12
10 applications
11 or
20
not.trees,
22
GiVe
specífy
cach
reasns
wheth of
(4)
stat.k
(6) for
er
J, Write(c) (b)
1263
elements Consider
performed
of
16
the
C++ a stack
of 22 23 iii)
pop ()push(6) push
(22) push push push
(12) (16), (2), pop(), push
(5), (10),
push onthe
an after
following a
program
array stack 25 26

each 7
using of 42
size
operation.sequence
to
asum 5.
recursive Show 2172551201

n' of
the
number operations
function. contents

(5)
(4) of
7. 1263

(c) (b) (a)


Explain
frontWrite giving thefor method What
tree

of a do
a
Master's for
aC++ suitable you
singly recurrence solving
program understand
linked example.
theorem recurrences.
8
to
list.insert
T(a)=r+T
for by
solving the
an DraW
element Recursion-tree
recurrences a
Recursion
3 2n
at Cn. +
(4) the (5) (6)

You might also like