Data Structures Jan 2023
Data Structures Jan 2023
UNIT-I
1. a) Write a program to reverse the given single linked list with [7M]
starting node as ‘head’.
b) What are the operations of stack? List its applications in [7M]
computer science.
(OR)
2. a) Write a program to implement stack using linked list. [7M]
b) How can we find the address of a second node from the end in a [7M]
single linked list? Write pseudo code for it.
UNIT-II
3. a) Write a program to implement selection sort. [7M]
b) Write a program to find maximum element in a binary tree. [7M]
(OR)
4. a) Write a program to implement binary search. [7M]
b) What is Hash function? What are its types? How can we handle [7M]
the collision using separate chaining and analyze its
performance?
UNIT-III
5. a) Write a program to insert an element into a Binary search tree. [7M]
b) What is an expression tree? Explain evaluation of an expression [7M]
tree with an example.
(OR)
6. a) Compare full and complete binary trees with examples. [7M]
b) Explain how can we delete a node with both the children from a [7M]
binary search tree? Give an example.
UNIT-IV
7. a) Construct an AVL Tree with the following elements and [7M]
determine the number of levels in the constructed tree.
25, 21, 32, 37, 45, 5, 9, 15, 84, 7, 91, 3, 6, 41, 1
b) Define B-Tree of order 5. Explain insertion procedure in B-tree of [7M]
order 5.
(OR)
8. a) Define AVL Tree. What are types of rotations performed while [7M]
inserting an element into an AVL tree?
b) Construct a B-Tree of order 5 with the following elements. [7M]
52, 85, 94, 65, 74, 84, 37, 15, 19, 21, 62, 77, 99, 101, 137
1 of 2
|''|'||||''|'''|||'|
Code No: R203105F R20 SET - 1
UNIT-V
9. a) Explain how can we find maximum element in the minimum [7M]
heap? Write a pseudo code for it.
b) What is a Splay tree? How it is different from binary search tree? [7M]
(OR)
10. a) Compare the implementation of search operation in binary [7M]
search, AVL and red black trees.
b) How to perform insertion and deletion in Priority Queue [7M]
implemented using min-heap? Explain with suitable examples.
2 of 2
|''|'||||''|'''|||'|
Code No: R203105F R20 SET - 2
|''|'||||''|'''|||'|
Code No: R203105F R20 SET - 2
UNIT-V
9. a) How can we find minimum element in the maximum heap? [7M]
Explain.
b) How to perform insertion and deletion in Priority Queue? Explain [7M]
with suitable examples.
(OR)
10. a) Write the implementation of search operation in red black trees.. [7M]
b) What is a Splay tree? How it is different from binary search tree? [7M]
List any two applications of splay trees.
2 of 2
|''|'||||''|'''|||'|
Code No: R203105F R20 SET - 3
1 of 2
|''|'||||''|'''|||'|
Code No: R203105F R20 SET - 3
UNIT-V
9. a) How can we find second minimum element in the minimum [7M]
heap?
b) What is a Splay tree? How it is different from binary search tree? [7M]
(OR)
10. a) Compare Binary search trees and Red-black trees? [7M]
b) Explain how to perform insertion and deletion in Priority Queue [7M]
implemented using max-heap? Explain with suitable examples.
2 of 2
|''|'||||''|'''|||'|
Code No: R203105F R20 SET - 4
III B. Tech I Semester Regular Examinations, Dec/Jan -2022-23
DATA STRUCTURES
(Common to CE,ME,ECE)
Time: 3 hours Max. Marks: 70
Answer any FIVE Questions ONE Question from Each unit
All Questions Carry Equal Marks
*****
UNIT-I
1. a) Write a program to implement queue using arrays. [7M]
b) Explain how to find whether the single linked list contains a loop? [7M]
Write a pseudo code for it. Assume the single linked list is having
initial node as ‘head’.
(OR)
2. a) What are the operations of Circular linked list? List its applications [7M]
in computer science.
b) Write a program to reverse the given single linked list with starting [7M]
node as ‘head’.
UNIT-II
3. a) Write a program to implement heap sort. [7M]
b) Derive the time complexity of quick sort in best, worst and average [7M]
cases. Give examples for each case.
(OR)
4. a) Compare linear search and binary search. [7M]
b) What is a collision? How can we use separate chaining for the [7M]
collision resolution?
UNIT-III
5. a) Write a program to perform search in a Binary search tree. [7M]
b) Derive the maximum number of comparisons performed to search for [7M]
an element in a binary search tree with n*2n nodes.
(OR)
6. a) What is a complete binary tree? Draw and Determine number of [7M]
levels of a complete binary tree with 14 nodes.
b) Construct a binary search tree with the following elements [7M]
45, 5, 9, 3, 6, 41, 1, 25, 21, 32, 15, 84, 7, 91, 37.
UNIT-IV
7. a) Construct an AVL tree with the following elements and determine the [7M]
height of the constructed tree
6, 41, 25, 21, 32, 37, 1, 45, 5, 9, 15, 84, 7, 91, 3.
b) Define B-Tree of order 5. Explain insertion procedure in B-tree of [7M]
order 5 with examples.
(OR)
8. a) Define AVL Tree. Prove that the height of the AVL tree with n nodes [7M]
is O(logn).
b) Construct a B-Tree of order 5 with the following elements and [7M]
determine the height of the constructed tree 219, 221, 162, 177,
299, 101, 137, 152, 185, 94, 165, 74, 284, 137, 115.
1 of 2
|''|'||||''|'''|||'|
Code No: R203105F R20 SET - 4
UNIT-V
9. a) Explain how can we find second maximum element in the [7M]
maximum heap? Write pseudo code for it.
b) Describe how to perform insertion and deletion in Priority Queue? [7M]
Explain with suitable examples.
(OR)
10. a) In which context AVL trees outperform Red-black trees? Justify. [7M]
b) What is a Splay tree? How it is different from binary search tree? [7M]
List any two applications of splay trees.
2 of 2
|''|'||||''|'''|||'|