1 GECP -EE
DSA ASSIGNMENT
1. Explain asymptotic notations (Big-O, Omega, and Theta) with examples. Compare their significance in
algorithm analysis.
2. What is the difference between linear and nonlinear data structures? Give examples of each.
3. Implement a stack using an array. Compare their advantages and disadvantages.
4. Implement a queue using an array. Explain circular queue and its advantages.
5. a. Convert the following infix expression to postfix and prefix notation:
(A + B * (C - D)) / (E + F * G)
b. Evaluate the following postfix expression using stack and show each step
15711 + - / 3 * 211 + + -
6. What are singly, doubly, and circular linked lists? Write an algorithm to insert and delete node in front ,
middle and back of doubly linked list
7.Explain binary search Tree. Write an algorithm to implement a binary search tree (BST) with insertion,
deletion, and search functions.
8. a. Explain heap data structure, max heap, min heap and heap sort with example.
b. Perform the heapify operation an array to convert it in Max Heap. Show step by step process of
heapifying the array starting from the last non-leaf node.
[ 4 , 10 , 5 , 3 , 8 , 10 , 14 , 3 ]
9. What is direct addressing in hashing? Explain collision resolution techniques such as chaining and open
addressing.
10. Implement the following sorting algorithms and analyze their time complexities:
Quick Sort
Merge Sort
Insertion Sort
11. Explain counting sort and radix sort with example
12. Write an algorithm of Depth First Search (DFS) and Breadth First Search (BFS) for a graph. Compare their
differences.
13. Explain Prim’s and Kruskal’s algorithms with example.
14 Explain and write Dijkstra’s algorithm to find the shortest path from a single source in a weighted graph.
Also analyze its time complexity
15.Take any weighted graph with 4 vertices and by using Floyd-Warshall’s algorithm find the shortest path
between all pair of vertices.
2 GECP -EE
16. Write a Python program to demonstrate variable assignments and different data types.
17. Explain mutable and immutable data types in Python with examples.
18. Implement a Python program that reads a text file and counts the occurrences of each word.
19. Implement a Python program to convert decimal numbers to binary, octal, and hexadecimal.
20. Explain list slicing and indexing with examples. Write a program to reverse a list without using the reverse()
function.
21. Implement a binary search algorithm and linear search algorithm in Python. Compare their performance.
22. Write a Python program to sort a list of dictionaries based on a specific key using lambda functions.
23. Implement a recursive function to calculate the factorial of a number.
24. Write a Python program demonstrating file handling (reading and writing a CSV file).
25.Explain Object oriented programming and its Four Pillars? Implement a student record management
system using classes and objects. The class should have attributes like name, roll_number, and marks.
26. Explain exception handling in Python. Write a program to handle division by zero and invalid user inputs.
27. Write a Python program to find the second largest and second smallest number in a list without sorting it.
28. Implement a Python calculator that takes input in the form of an expression (e.g., 5 + 3 * 2) and evaluates
it.
29. Implement a Python program to traverse a dictionary, adding and removing keys dynamically.