DS - 2023
DS - 2023
DS - 2023
MODULE – I
1. (a) State the properties of an algorithm. Explain the quick sort algorithm with an example and write
the time complexities. [BL: Understand| CO: 1|Marks: 7]
(b) Consider a given list of integers 10, 18, 19, 20, 25, 28, 48, 55, 62, 70 and describe the steps to
implement the binary search method. Write a Python program to find the desired element 25 in
the given list using binary search. [BL: Apply| CO: 1|Marks: 7]
MODULE – II
2. (a) List out the applications of stack. Write a Python program for i) Push ii) Pop iii) Display
operations using the same definition. [BL: Understand| CO: 2|Marks: 7]
(b) Write a program for reversing a linear queue Q. The following standard operations are allowed
on queue.
enqueue(x) : Add an item x to rear of queue.
dequeue(x) : Remove an item x from front of queue.
empty() : Checks if a queue is empty or not. [BL: Apply| CO: 2|Marks: 7]
MODULE – III
3. (a) Differentiate between creation of singly linked list node and double linked list node. Implement
double ended queue (DEQUE) using circular doubly linked list.
[BL: Understand| CO: 3|Marks: 7]
(b) Develop a GetNth() function that takes a linked list, an integer index and returns the data value
stored in the node at that index position.
Example: Input: 1->10->30->14, index = 2
The node at index 2 is 30. [BL: Apply| CO: 3|Marks: 7]
Page 1 of 2
MODULE – IV
5. (a) Explain spanning tree and minimum spanning tree. Write pseudocode to find minimum
spanning tree using Kruskal’s algorithm with example. [BL: Understand| CO: 5|Marks: 7]
(b) Write recurssive algorithms for the given tree in Figure 1 and give
i) Inorder traversal ii) Preorder traversal iii) Postorder traversal
[BL: Apply| CO: 5|Marks: 7]
Figure 1
6. (a) Outline the following with example i) Strictly binary tree ii) Skewed binary tree iii) Complete
binary tree [BL: Understand| CO: 5|Marks: 7]
(b) Give the depth first traversal (DFS) for the following graph given in Figure 2.
[BL: Apply| CO: 5|Marks: 7]
Figure 2
MODULE – V
7. (a) Mention the properties of binary search tree (BST). Discuss the AVL tree rotaion techniques
with example. [BL: Understand| CO: 6|Marks: 7]
(b) A phone book is stored in a text file, containing names of people, their city names and phone
numbers. Write a Python program by choosing an appropriate data structure to search a person’s
phone number based on his/her first name and city. [BL: Apply| CO: 6|Marks: 7]
8. (a) Summarize about hashing. Describe the collision resolution techniques separate chaining and
open addressing with suitable examples. [BL: Understand| CO: 6|Marks: 7]
(b) Consider a hash function as “key mod 7” and sequence of keys as 50, 700, 76, 85, 92, 73, 101
using separate chaining. Also write the advantages of separate chaining.
[BL: Apply| CO: 6|Marks: 7]
−◦◦ ◦◦−
Page 2 of 2