Code No.
: 22CSC35
CHAITANYA BHARATHI INSTITUTE OF TECHNOLOGY (Autonomous)
[Link]. (Chem) III Sem (Main/Backlog) Examination December 2024
Data Structures using Python
Time: 3 Hours Max Marks: 60
Note: Answer ALL questions from Part-A at one place in the same order and Part–B
(Internal Choice)
Part - A
(5Q X 2M = 10 Marks)
M CO BT
1 What is a class in Python? (2) 1 2
2 Give the time complexity of merge sort. (2) 2 2
3 Mention the advantages of a linked lists over an array. (2) 3 4
4 Define a graph data structure in python? (2) 4 1
5 Define a hash table and explain its basic operation. (2) 5 4
Part - B
(5Q X 10M = 50 Marks)
M CO BT
6 (a) Write a python program to create simple class and use it to instantiate (5) 1 3
objects in Python
(b) Define scatter plot and discuss its usefulness for data visualization with (5) 1 2
an example.
(OR)
7 (a) Define a Pandas Series. Write a python program to create a Pandas Series. (5) 1 2
Also explain five member functions of Pandas Series.
(b) Write a Python program to group numeric data into bins using specific (5) 1 3
intervals?
8 (a) Discuss in detail about asymptotic notation used for best case analysis of (5) 2 3
algorithms
(b) Perform selection Sort for the following list: 12, 3, 8, 23, 1, 8, 9, 34. (5) 2 2
(OR)
9 (a) What is data structure? What are the differences between linear and (5) 2 2
nonlinear data structures?
(b) Write a Python program to implement quicksort. (5) 2 4
10 (a) Write an algorithm to insert an element at the beginning of singly linked (5) 3 1
list.
(b) Write a Python program to implement a queue. (5) 3 4
(OR)
11 (a) Write the procedure to delete an element from the end of singly linked (5) 3 1
list.
(b) Write a Python program code snippet to display all the nodes of a doubly (5) 3 3
linked list in both forward and reverse order.
Page 1 of 2
Code No.: 22CSC35
12 (a) Define Binary Search tree? Draw a BST for the following List: (5) 4 2
10,12,43,7,56,34,67,87,98 and delete 10 from the tree.
(b) List any five differences between breadth first search (BFS) and depth (5) 4 3
first search (DFS).
(OR)
13 (a) Discuss briefly about any 3 types of binary trees. (5) 4 2
(b) Explain graph representations in detail with examples (5) 4 2
14 Discuss the Rabin- Karp string matching algorithm for given text and (10) 5 2
string, and analyse it’s time complexity.
Text: caccaadbafcd
String: aadbaf
(OR)
15 Explain any three hash functions with examples and implement them (10) 5 4
using python code.
*****
Page 2 of 2