Data Structures Exam Paper 2023
Data Structures Exam Paper 2023
1.a) The following numbers 10, 20, 50, 30, 90, 60 (Top) are present in a stack of size 10.
Perform the following operations in sequence. pop(), push(30), push(40), pop(),
U
push (60), pop(), pop(), pop() What is the peek element at last? Draw and explain it.
b) Implement a queue data structure using Single Linked list. [8+7]
se
2.a) The Professor Lilly is very strict in class room. She never gives the attendance to those
who are coming last in her class. Write a function to help Professor to delete the last
d
Occurrence of a student from the list.
b) Implement a stack data structure using Single Linked list. [8+7]
pa
3.a) Explain how Insertion, Deletion and Search is done in skip lists with example.
b) What is the expected number of probes for both successful and unsuccessful searches
in a linear probing table with load factor 0.25? [7+8]
pe
4.a) Given the input (4371, 1323, 6173, 4199, 4344, 9679, 19891), a fixed table size of 10,
and a hash function H(X) = X mod 10, show the resulting quadratic probing hash table.
rA
b) Outline Double Hashing with an example. [8+7]
5.a) In an initially empty AVL tree insert the following keys: DEC, JAN, APR,MAR, JUL,
AUG, OCT, FEB, NOV. Draw AVL tree after every insertion and apply rotations
ug
where ever necessary.
b) Briefly discuss about different cases of imbalance that might be caused by a red-black
tree insertion and corresponding methods to rebalance the tree. [7+8]
-2
6.a) Construct Splay tree with the following node values: 18, 10, 5, 28, 13, 25,
42,3,56,2,68,1,90. And perform normal splaying at nodes 1 and at node 90.
b) Explain insertion operation with following numbers into Red Black tree
02
45, 10, 8, 9, 34, 35, 12, 60, 90. [7+8]
7.a) Assume a list containing 4500 records is to be sorted using a computer with internal
2
memory capable of sorting at most 750 records at a time and input list is maintained on
a disk that has block length of 250 records. For this scenario explain how external
sorting may be performed to accomplish the task.
b) Compare BFS and DFS with suitable examples. [8+7]
JN
8.a) Solve the Boyer-Moore algorithm for the following Example:
Text: ABCABCDABABCDABCDABDE
Pattern: ABCDABD
TU
b) Solve the Knuth Morris-Pratt algorithm for the following Example:
Text: HEREISASIMPLEEXAMPLE
Pattern: EXAMPLE [8+7]
H
---oo0oo---
U
se
d
pa
pe
rA
ug
-2
02
2
Code No: 153AK
R18
JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD
B.Tech II Year I Semester Examinations, March - 2021
DATA STRUCTURES
(Common to CSE, IT, ITE)
Time: 3 hours Max. Marks: 75
Answer any five questions
All questions carry equal marks
---
2. What are different methods of collision resolution in hashing? Explain in brief. [15]
-0
3.a) Discuss in detail about red-black trees.
b) Explain briefly about binary search trees. [7+8]
3-
4. How a graph is traversed using depth first search? Explain with example. [15]
20
5. Explain the process of heap sort with example. [15]
---ooOoo---
Code No:153AK R18
JN
JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD
B.Tech II Year I Semester Examinations, March - 2022
DATA STRUCTURES
(Common to CSE, IT, ECM, CSBS, CSIT, ITE, CSE(SE), CSE(CS), CSE(AIML), CSE(DS),
TU
CSE(IOT), CSEN)
Time: 3 Hours Max. Marks: 75
Answer any five questions
All questions carry equal marks
H
---
1.a) Define a single linked list. Write the structure of the linked list with a neat sketch.
U
b) Explain the operations of queue. [8+7]
5.a) Construct a Red-Black tree with the following elements 40, 16, 36, 54, 18, 7, 48, 5. Delete
element 18 and add element 66.
er
b) Write an algorithm of single rotation and double rotation of an AVL tree. [9+6]
s
6.a) Explain the splaying operations of splay tree with an example.
b) Define Binary search tree. [12+3]
M
7.a) Write an algorithm to implement a depth-first search with an example.
b) Perform heap sort algorithm for (10 15 6 2 25 18 16 2 20 4). [12+3]
ar
8.a) Difference between tree and tries.
b) Illustrate the Brute force algorithm. [5+10]
c
---oo0oo---
h
20
22
Code No: 153AK
R18
JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD
B.Tech II Year I Semester Examinations, October - 2020
DATA STRUCTURES
(Common to CSE, IT)
JN
1.a) Write an algorithm of Insert and Delete operation in Singly Linked List.
b) Convert the following infix expression into postfix expression
A+B–C*D*E$F$G [7+8]
H
2. Explain about the various hash collision resolution techniques with an example. [15]
U
3. Insert the following list of elements from the AVL tree. Delete the elements 18, 2 and 30
from the AVL tree 12, 30, 36, 18, 25, 9, 4, 2, 17, 14 , 20, 47 [15]
SE
7. Explain about:
-1
a) Rehashing
b) Extendible hashing. [15]
1-
8. Write an algorithm to delete an element from the binary search tree. [15]
20
---ooOoo---
20
AM
Code No: 153AK
R18
JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD
B.Tech II Year I Semester Examinations, September - 2021
DATA STRUCTURES
(Common to CSE, IT, ITE)
Time: 3 hours Max. Marks: 75
Answer any five questions
All questions carry equal marks
---
U
2. Insert the following list of elements into the hash table by using Quadratic probing (size
of Hash table is 13) 65, 34, 79, 114, 26, 85, 55, 89, 22, 98. [15]
d
3. Insert the following list of elements from the Red- Black tree. Delete the elements 18, 2
Pa
and 30 from the Red-Black tree 12, 30, 36, 18, 25, 9, 4, 2, 17, 14, 20, 47. [15]
6.a) Write an algorithm for insertion of node at last position in Linear Linked List.
b) Evaluate the following postfix expression using stack. Show each step
SE
5 3 + 6 2 / * 3 5 * +. [7+8]
---ooOoo---
21
Code No: 123BP R15
JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD
JN
B.Tech II Year I Semester Examinations, April/May - 2018
DATA STRUCTURES
(Common to CSE, IT)
TU
Time: 3 Hours Max. Marks: 75
PART- A
U
(25 Marks)
1.a) What is space complexity? [2]
SE
b) What is Big-O and Omega Notation? [3]
c) What is a Queue? Give its basis operation. [2]
d) Convert to postfix: 2+3*4+6/2. [3]
e) State the different representations of a Graph. [2]
D
f) What is a Max-heap? [3]
g) What is the time complexity of linear search? [2]
h) What is a hash function? Give example. [3]
21
i) What is a Red-Black Tree? [2]
j) What is an AVL Tree? [3]
-0
PART-B
(50 Marks)
2. What is a Circular Linked List? Write an algorithm for insertion and searching an
5-
element into a circular linked list. [10]
OR
3.a) How to represent One, Two, Three and Multidimensional arrays in C? Explain with
20
example.
b) What is a sparse matrix? Give representations. [5+5]
1
4. What is a Stack? Explain all the primitive operations performed on a stack. [10]
OR
8P
5. What is a Circular Queue? Explain various operations on a Circular Queue. [10]
1.a) Define data structure. Discuss different types of data structures and their application.
b) Write an algorithm to insert new node at the beginning and at the end of a Singly Linked
18
List. [7+8]
2.a) Explain the procedure to evaluate postfix expression. Evaluate the following Postfix
expression 7 3 4 + - 2 4 5 / + * 6 / 7 +.
-0
b) Write an algorithm to push and pop an element from linked stack. [7+8]
3.a) What is a binary tree? Construct a binary tree given the pre-order traversal and in-order
3-
traversals as follows:
Pre-Order Traversal: G B Q A C K F P D E R H
20
In-Order Traversal: Q B K C F A G P E D H R
b) What is a graph? Explain the properties of graphs. [7+8]
4.a) Rearrange following numbers using quick sort: 10, 6, 3, 7, 17, 26, 56, 32, 72.
21
b) Discuss in detail about Linear and Binary search. [7+8]
5. Develop a binary search tree resulting after inserting the following integer keys
49, 27, 12, 11, 33, 77, 26, 56, 23, 6.
AM
a) Check whether the tree is almost complete or not?
b) Determine the height of the tree
c) Write post order and preorder traversals. [5+5+5]
8.a) Show that the maximum number of nodes in a binary tree of height H is 2H+1-1.
b) Write breadth first traversal algorithm. Explain with an example. [7+8]
---ooOoo---
JN
Code No: 123BP R15
JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD
B.Tech II Year I Semester Examinations, March - 2022
TU
DATA STRUCTURES
(Common to CSE, IT)
Time: 3 Hours Max. Marks: 75
Answer any five questions
H
All questions carry equal marks
---
U
1.a) Explain the concept of asymptotic notations, indicating the normally used notations.
b) List out any two applications of linked list and two advantages of doubly linked lists over
singly linked list. [8+7]
se
2.a) Explain the insertion and deletion operations in doubly lined list.
b) What are the properties of sparse matrix? [12+3]
dp
3.a) With an example, explain the operations performed on stacks.
b) What are the applications of stack? [10+5]
ap
4.a) Explain various operations that are performed on queue with suitable algorithms.
b) Explain about Deque. [10+5]
er
5.a) Construct the binary tree whose following traversals are given:
inorder : DFEIHBAJCNOMK
s
postorder: FIHEDBJONMKCA
b) Give the difference between tree and graph. [11+4]
M
6.a) Define Max-heap. Write Max-Heapify algorithm that maintain max-heap property.
b) Explain about threaded binary tree. [10+5]
ar
7.a) Construct the open hash table and closed hash table for the input: 30, 20, 56, 75, 31, 19
using the hash function h(k)= k mod 11.
c
b) Explain about insertion sort with an example. [9+6]
h
8.a) Discuss Knuth Morries Pratt (KMP) algorithm. Compute whether the pattern
P=10100111 is present in the string T=1001010100111 or not.
20
b) Discuss about splay trees. [10+5]
22
---ooOoo---