0% found this document useful (0 votes)
213 views15 pages

Data Structures Exam Paper 2023

DSS
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)
213 views15 pages

Data Structures Exam Paper 2023

DSS
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

Code No: 153AK R18

JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD


B. Tech II Year I Semester Examinations, April/May - 2023
DATA STRUCTURES
JN
(Common to CSE, IT, ECM, CSBS, CSIT, ITE, CE(SE), CSE(CS), CSE(DS), CSE(IOT),
CSE(N), AI&DS, AI&ML, CSD)
Time: 3 Hours Max. Marks: 75
TU
Note: i) Question paper consists of Part A, Part B.
ii) Part A is compulsory, which carries 25 marks. In Part A, Answer all questions.
iii) In Part B, Answer any one question from each unit. Each question carries 10 marks
and may have a, b as sub questions.
H
PART – A
(25 Marks)
U
1.a) Give examples for stack. [2]
se
b) How to construct a queue using stacks? [3]
c) What is a skip list? [2]
d) List the drawbacks of open addressing. [3]
e) What does the color notate in red-black tree? [2]
d
f) What operations are performed on Splay trees? [3]
g) What is a max heap? [2]
pa
h) Give example for adjacency list of a graph. [3]
i) Define trie. [2]
j) What are the merits and demerits of brute force method for pattern matching? [3]
pe
PART – B
(50 Marks)
rs
2. Write and explain algorithms for Push and pop operations of stack using linked list.[10]
OR
3.a) Describe the conditions of overflow and underflow in a queue.
20
b) Discuss the applications of queues. [5+5]

4.a) Demonstrate skip list representation of a dictionary.


b) How to perform reassign operation on a dictionary. [5+5]
23
OR
5. Explain the algorithm for implementing quadratic probing on a hash table. [10]

6.a) Illustrate search operation on binary search tree.


b) Discuss the importance of height balanced trees for searching. [5+5]
OR
7.a) With suitable examples, illustrate right-left rotation on AVL tree.
b) Differentiate between splay tree and red-black tree. [5+5]
8. Make a comparison of breadth first search and depth first search for a graph. [10]
OR
JN
9. Write an algorithm for merge sort and explain with a suitable example. [10]

10. Describe the Knuth-Morris-Pratt algorithm for pattern matching. [10]


OR
TU
11. “A compressed trie is an advanced version of the standard trie.” Support or oppose this
statement with necessary explanation. [10]
H
---ooOoo---
U
se
d
pa
pe
rs
20
23
Code No: 153AK R18
JN
JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD
B.Tech II Year I Semester Examinations, August/September - 2022
DATA STRUCTURES
(Common to CSE, IT, ECM, CSBS, CSIT, ITE, CSE(SE), CSE(CS), CSE(AIML), CSE(DS),
TU
CSE(IOT), CSE(N))
Time: 3 Hours Max.Marks:75
Answer any five questions
All questions carry equal marks
H
---

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
---

1.a) Discuss in brief about single linked list.


10
b) Write a C program to convert infix to postfix expression. [7+8]

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]

6. Explain in brief about tries with example. [15]


21
7. Compare and contrast different sorting methods. [15]

8. Explain in detail about skip lists in data structures. [15]


AM

---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]

2.a) Write a program to implement stack operations.


se
b) What are the applications of the queue? Explain. [8+7]

3.a) Explain the operations of the skip list representation.


dp
b) Is linear probing and open addressing same? Justify your answer. [10+5]

4.a) Discuss the hash functions.


ap
b) List and explain the advantages of extendible hashing. [10+5]

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

Time: 2 hours Max. Marks: 75


Answer any five questions
All questions carry equal marks
---
TU

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

4.a) Differentiate between BFS and DFS.


b) Explain about external sorting with an example. [7+8]
D

5.a) Write an algorithm of compressed Trie.


b) Explain about the Brute force algorithm with an example. [7+8]
05

6.a) Write a program to implement stack using linked list.


b) Explain the operations of Queue with an example. [8+7]

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

1.a) Write an algorithm of Push and Pop operations on a stack.


b) Differentiate between stack and queue. [8+7]
se

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]

4. Sort the following list of elements by using Merge sort


30, 56, 78, 99, 12, 43, 10, 24, 85 [15]
pe

5.a) Write an algorithm of Standard Trie.


b) Explain the features that distinguish between Boyer Moore algorithm from the
conventional algorithms. [7+8]
rs

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]

7. Write an algorithm of skip list operations insertion and deletion. [15]


P

8. Explain the operations of Splay tree with an example. [15]


20

---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

Note: This question paper contains two parts A and B.


Part A is compulsory which carries 25 marks. Answer all questions in Part A.
Part B consists of 5 Units. Answer any one full question from each unit.
H
Each question carries 10 marks and may have a, b, c as sub questions.

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]

6.a) Construct an expression tree for the given expression: A+(B-C)*D+(E*F).


b) A binary tree has 9 nodes. The inorder and postorder traversal sequences are given below.
M
Give the preorder traversal.
Inorder: D G B A H E C F I
Postoder: G D B H E I F C A [5+5]
OR
7. Explain BFS and DFS algorithms. [10]
8. Explain linear search and binary search. Which method is efficient in terms of
complexity? [10]
JN
OR
9. Explain how to sort the array of elements using heap sort. [10]
TU
10. Write an algorithm for insertion and deletion in a Binary Search Tree? [10]
OR
11. Show each step of the AVL Tree built from a sequence of insertions corresponding to the
following keys 44,17,32,78,50,54,62,48,88? [10]
H
---ooOoo---
U
SE
D
21
-0
5-
20
1 8P
M
Code No: 123BP R15
JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD
B. Tech II Year I Semester Examinations, April/May - 2023
DATA STRUCTURES
JN
(Common to CSE, IT)
Time: 3 Hours Max. Marks: 75

Note: i) Question paper consists of Part A, Part B.


TU
ii) Part A is compulsory, which carries 25 marks. In Part A, Answer all questions.
iii) In Part B, Answer any one question from each unit. Each question carries 10 marks
and may have a, b as sub questions.
H
PART - A
(25 Marks)
U
1.a) Describe the role of space complexity and time complexity in measuring the
performance of a program. [2]
b) Differentiate between recursive and iterative algorithms. [3]
se
c) List the applications of stack. [2]
d) Differentiate Stack and Queue. [3]
e) Define a full binary tree and complete binary tree. [2]
d
f) List the applications of Trees. [3]
g) Define Hashing. [2]
pa
h) State different types of collision resolving techniques. [3]
i) Compare binary tree and binary search tree. [2]
j) Write the properties of B-Trees. [3]
pe
PART - B
(50 Marks)
rs
2. Discuss various the asymptotic notations used for best case, average case and worst
case analysis of algorithms. [10]
OR
3. Write a program to insert an element in between two nodes in a double linked list. [10]
20
4.a) Explain the procedure to evaluate postfix expression.
b) Convert the following expression A + (B * C) - ((D * E + F) / G) into postfix form.
23
[5+5]
OR
5. Implement a Circular queue of integer of user specified size and write the functions for
initialize(), enque() and deque(). [10]

6.a) Discuss representation of binary tree.


b) Explain DFS graphs traversal algorithms with suitable example. [5+5]
OR
7.a) Explain with an example how to delete an element from maxheap.
b) Construct max heap for 150, 80, 40, 30, 10, 70, 110, 100, 20, 90, 60, 50, 120, 140, 130.
[5+5]
8.a) Explain Binary search with example.
JN
b) Explain the different hashing functions with an example. [5+5]
OR
9.a) State and explain radix sort with an example.
b) Apply heap sort on list of elements 14, 12, 9, 8,7,10,18,20,30. [5+5]
TU
10.a) Explain the insertion operation on AVL trees.
b) Insert the following sequence of elements into an AVL tree, starting with an empty
space: 10, 20, 15, 25, 30, 16, 18, 19 and delete 30 in the AVL tree that you got. [5+5]
H
OR
11.a) Explain Splay trees with example.
b) Construct a B-tree of order 3 with the following elements
U
25,10,20,30,80,40,50,60,82,70,90,85,93. [5+5]
se
---ooOoo---
d
pa
pe
rs
20
23
Code No: 123BP
R15
JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD
JN
B.Tech II Year I Semester Examinations, August/September - 2022
DATA STRUCTURES
(Common to CSE, IT)
Time: 3 hours Max. Marks: 75
TU
Answer any five questions
All questions carry equal marks
---
H
1.a) Write applications of single linked list to represent polynomial expressions.
b) Explain sparse matrix representation using array with an example. Discuss the advantages
and disadvantages of the method. [7+8]
U
2.a) Explain the basic operations of queue with pseudo code.
b) Write an algorithm to insert and delete a key from circular queue. [7+8]
se
3.a) Construct max heap for the following:
140, 80, 30, 20, 10, 40, 30, 60, 100, 70, 160, 50, 130, 110, 120
d
b) Discuss representation of Graph using arrays and linked list. [7+8]
pa
4.a) State and explain insertion sort with example.
b) Define hashing. Explain various types of collision resolution techniques in hashing.
[7+8]
pe
5.a) What is a binary search tree? Write an algorithm for inserting and deleting a node in a
binary search tree.
b) Write a short note on AVL trees and RED Black trees. [7+8]
rA
6.a) Show how to reverse a single linked list.
b) List various operations of linked list and explain how to insert a node anywhere in the
single linked list. [7+8]
ug
7.a) Explain the procedure to convert infix expression to postfix expression with the following
expression: ((A –(B+C) * D) / (E+F))
b) Write an algorithm for evaluating a postfix expression using stack. Evaluate the
-2
following postfix notation 123*+5- [7+8]
02
8.a) Explain in-order traversal of threaded binary tree with an example.
b) Write in-order, pre-order and post-order traversal of a binary tree. [7+8]
2
---ooOoo---
Code No: 123BP/113BP
R15/R13
JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD
B.Tech II Year I Semester Examinations, March - 2021
DATA STRUCTURES
(R15 - Common to CSE, IT; R13 - Common to CSE, IT)
Time: 3 hours Max. Marks: 75
Answer any five questions
All questions carry equal marks
---

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]

6.a) What is an array? Discuss different types of array with examples.


b) Explain polynomial addition using arrays. [7+8]

7.a) Convert following expression x+(y*z)–((n*m+o)/p) into post form.


b) Discuss sparse matrix representation using linked list. [7+8]

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---

You might also like