ADSA 5th Unit Assignment
ADSA 5th Unit Assignment
Maximum Marks: 64
Q.1. [CO1] Define what a graph is and explain the difference between directed and undirected graphs.
Q.2. [CO1] Discuss the advantages and disadvantages of using an array-based representation versus a linked list-based
representation for graphs.
Q.3. [CO1] Describe the steps involved in the Insertion Sort algorithm and analyze its time complexity in the best,
average, and worst-case scenarios.
Q.4. [CO1] Compare and contrast linear search and binary search algorithms, discussing their time complexity and when
each would be most appropriate.
Q.3. [CO1 Implement a graph using both array-based and linked list-based representations.
Section 3. (Answer the following questions) (3x11=33 marks)
Q.1. Write a Python class to represent an undirected graph using an adjacency list. Include methods to add vertices and
edges, check if an edge exists between two vertices, and perform Depth-First Search (DFS) traversal. Test your
implementation with a sample graph and demonstrate the results of DFS traversal.
Q.2. [CO1] Implement the Bubble Sort algorithm. Provide a detailed explanation of how the algorithm works and its
time complexity analysis. Test your implementation with various input sizes and analyze its performance. Discuss
any observations or insights gained from your analysis.
Q.3. [CO1] Develop a program that combines searching and sorting algorithms. Implement a function that takes an
unsorted list of integers as input, performs a binary search to find a target value, and then sorts the list using the
Insertion Sort algorithm. Test your program with different input lists and provide a step-by-step explanation of the
search and sort processes.