We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 8
Course Code: CSE2001
iy VIT-AP
2% UNIVERSITY
‘Analy Rnosrletge, prove Lift
QUESTION PAPER
CAT (FALL 2022-2023)
Slot: D2*TD2 Date of Exam: 03-11-2022
Duration: 90 min Total Marks
0
Instruction:
1. Answer all the questions.
at. a)
b)
2. (a)
(b)
Qs. (a)
(b)
Q4. (a)
(b)
Explain Big-Oh notation. Define c, and no for which the
equation 27n? + 16n + 25 = O(n’),
Compute the time complexity of the following code
inti, j
Construct a postfix expression from the given infix
expression
A+BAC+(D*E/F)*G
Evaluate the postfix expression using stack
7344-245/+*6/7+
Design an algorithm to insert an element at the end position
of a Circular Queue.
Design an algorithm to delete an element at any position of
a single Linked List.
Construct a binary search tree from the following integer
keys
49, 27, 12, 11, 33, 77, 26, 56, 23, 6, 1, 38, 17.
Construct the binary tree from the given below traversing
order
In order : 4, 6,7, 8, 9, 12, 14, 15, 16, 17, 18, 20, 25
Post order : 6, 8, 7, 4, 9, 14, 12, 17, 18, 16, 25, 20, 15
Course Title: Data Structures and Algorithms
(6 Marks)
(6 Marks)
(8 Marks)
(6 Marks)
(5 Marks)
|
(6 Marks)
(6 Marks)
(6 Marks)
Page 1 of 2Q5. Define height balanced binary search tree.
| Construct @ height balanced binary search tree from the
| following elements 15, 20, 12,
16, 9, 18, 14, 4, 7, 26, 22, 2,1,
(10 Marks)
36,17.
Module | CO PO =) i)
Q.No. | Number | Mapped | Mapped Neca Mapped) yeu marke
a | 7 cot POI = PSOt 10
@ | 2 02 POt PSOt 10
[93 2 co2 POt E PSOt 70
ow | 3 O83 PO3 = PSOt 10
a | 3 03 POS 7 PSOt 70
Page 2 of 2UNIVERSITY.
entadge. Inprova Lift
QUESTION PAPER
Name of the Examination: FALL 2022-2023 -FAT
Course Code: CSE2001 Course Title: Data Structures and Algorithms
Set number: 1 Date of Exam: 99-19-3022-( An) C Pe]
Duration: 120 Minutes Total Marks: 60 Marks
Instruction: Answer ALL the questions.
ai
Q2
Q3
a4
Construct a Binary Search Tree for the following node order: [12 Marks]
50,60,40,70,30,80,20
Check if the height of BST is balanced or not?(using AVL tree property). If
not balanced, reconstruct the BST using rotation properties to balance the
height such that each node should have a value of -1 or 0 (Zero) or 1.
Alter the reconstruction of the tree, perform the following operations in order
and ensure the height of each node should have the value of -1 or 0 or 4.
i) insert the node 90
ii) delete the node 70
ii) insert the node 45
iv) insert the node 48
Consider the following array S: [8 Marks]
80 70 | 0 |s0 40 | 30 | 20 | 10
Write an algorithm to sort array $ using the following scenario and find the
time complexity of sorting with respect to given S.
Select a specific element x from S
L, storing the elements in S less than x
E, storing the elements in S equal to x
G, storing the elements in $ greater than x
Recursively sort sequences L and G and Put back the elements into S in order by
first inserting the elements of L, then those of E, and finally those of G
Consider the following array A: [8 Marks]
36 | 24 8]
Apply bubble sort and write the array values after every pass and calculate
the time complexity.
12/10 | 25 |
Demonstrate the extendible hashing by inserting the following key elements. [8 Marks]
179,2,15,86,33,44,28,158 with the bucket size 3.
Page 1 of 2Q5 Consider the following key elements to be loaded in hash table.
Key elements= (18,77, 15,44,70,19,81,32}. Here hash table size is 11
Hash funotion is h(k)= (2k? + 3k+4). Use division method,
i) Use linear probing and get the order of elements.
ii) Perform rehashing and find the order of elements.
Consider the following graph G. Find the shortest distance between vertex
‘a’ to '? and ‘a’ to ‘e’ using Dijkstra’s algorithm.
a6
Q7 Check the given graph is complete graph or not. Find the minimum spanning
tree of the graph G using Kruskal's algorithm. The starting vertex is “A”.
mee
36 24
22 35 Oe
42 25 19
18 39
65
1204
[8 Marks}
[8 Marks]
[8 Marks]
23
33 21
We
QP MAPPING
Modul co 0
@.No. | Number Mapped Mapped Mapped Mapped Marks
3 3 3 i BAP ete) 12
4 4 4 1,4 1,4 8
4 4 4 44 14 8
| § 5 3 12,3 13 8
5 | 5 a 12,3 13 8
6 6 3 16 1,2 8
6 6 3 16 1.2 a |
Page 2of 2UNIVERSITY
‘Apply Knowledge. Improve Life!”
QUESTION PAPER
Name of the Examination: FALL 2022-2023-FAT
Course Code: CSE2001 Course Title: Data Structures and Algorithms
Set number: 4 Date of Exam: 93-)a-R0r2 AN CEs)
Duration: 120 Minutes Total Marks: 60
Instruction: Answer ALL the questions.
Qi.
Q2,
a3.
Explain the concept of AVL trees with all the possible rotation for restoring
balance. Show how the values 14, 17, 11, 7, 53, 4,13 are inserted Into an
empty AVL tree one by one followed by the deletions of 63 and 11.
[12 Marks}
a) Write an algorithm for Selection Sort. Explain the working of the algorithm
on the following data. Show the array elements after every iteration.[8 Marks]
1361 |92 43 31 [4s |57|26 75 o|
b) Write an algorithm for Heap sort. Indicate the sequence of values after
create (max) heap and at the end of every iteration. [8 Marks]
42 | 23 [75 12 |66 |35 |96 [58 |9 | 82
a). Given input (2341, 4234, 2839, 430, 22, 397, 3920} and a hash function
h(x)= x mod 7, show the resulting: [8 Marks]
i) Separate chaining hash table.
fi) Open addressing hash table using linear probing
lil) Open addressing hash table using quadratic probing
iv) Open addressing hash table with second hash function h(x) =(2x-1) mod 7.
b). Interpret the result inserting keys 16,4,6,22,24,10,31,7,9,20,26 into an
initially empty extendible hashing data structure with bucket size=3. [8 Marks]
Page 1 of 2Q4, a). Compute the
each iteration.
b). Find the minimum cost spanning tree for the following
shortest path from node 0 using Dijkstra's algorithm. Sketch
[8 Marks]
graph step by step
procedure using Prim's algorithm (starting Node is ‘a’) [8 Marks}
QP MAPPING
Module | CO PO PEO PSO
Q.No.| Number | Mapped | Mapped | Mapped | Mapped Marks
a 3 3 14 14 1 mz]
Q2 4 4 14 12 2 16
as_ | 5 4 72,3 13 2 6
a [6 mo 24 12 2 6
Page 2 of 2UNIVER:
“Apply Knowledge, Improve Life!”
QUESTION PAPER
Name of the Examination: FALL 2022-2023 - FAT
Course Code: CSE2001 Course Title: Data Structures and Algorithms
Set number: 7 Date of Exam: 3-2-2022 FN CE]
Duration: 120 Minutes Total Marks; 60 Marks
1. Construct an AVL tree by inserting the following sequence of elements 10, 12, 8,
4, 20, 8, 7, 15, 13, 77, 35, 81 starting from an empty tree and delete the nodes
following nodes after the complete construction of AVL tree.
Nodes to be deleted : 5,13,77,20 (12 Marks)
Q2. Construct max heap for the following:
140, 80, 30, 20, 10, 40, 30, 60, 100, 70, 160, 50, 130, 110, 120 (8 Marks)
Q3. Explain how many passes are required to sort the following list of elements
10, 80, 30, 90, 40, 50, 70,80,45,25 using Merge sort. Illustrate each pass of merge
sort. (8 Marks)
Q4, Draw a hash table with open addressing and a size of 9. Use the hash function
h(k) = k%69 and insert the given keys in to hash table using following hash method.
12, 18, 13, 2, 3, 23, 5, 15 (8 Marks)
Linear Probing
ji) Quadradic probing
il)Double hashing (Hash function 2 is h(k}=(Sk+2)mod 9)
Q5. Consider a textbook with 00 pages. A faculty asks the students to go to a page
number 232 to teach a particular topic. Identify a strategy to go to the page number
wwith minimum number of comparison. Discuss about Its time complexity. (8 Marks)
Q6. Find the minimum spanning tree using Prim’s algorithm for the given graph
(8 Marks)
® —.
Page 1 of 27. Consider the given graph. Depict the steps to find the shortest path from node “1°
to all the remaining nodes using Dijkstra’s algorithm. (8 Marks)
( a — )
12
oO
\ QP MAPPING
Module | COMapp | PO PEO PSO
Q.NO. | Number | ed Mapped | Mapped | Mapped Marks
Qi 3 4 1 2 4 2
az 4 4 1 2 1 8
a3 4 4 1 2 1 8
a4 5 4 2 2 1 8
Qs 5 4 2 2 1 8
Qs 6 3 3 2 1 8
a7 6 3 3 2 1 8
Page 2 of 2