Design & Analysis of Algorithms
Instructions:
- The marks are indicated in the right-hand margin.
- There are NINE questions in this paper.
- Attempt FIVE questions in all.
- Question No. 1 is compulsory.
An algorithm is said to be finite if
In Master’s theorem, if f(n) = Θ(nlogba), then the solution of the recurrence is
What is the maximum number of swaps that can be performed in the Selection Sort algorithm?
The time complexity of Strassen’s Matrix Multiplication is approximately
Which of the following problems can not be solved optimally by a greedy approach?
In the Branch-and-Bound approach for the Traveling Salesman Problem (TSP), bounding is used to
In the Matrix Chain Multiplication problem, the DP table stores
In 0/1 Knapsack DP solution, the state K[i][w] represents
Topological sorting is applicable to
An approximation algorithm guarantees
Solve the following recurrence relations using the Substitution Method:
(i) T(n)= 2T(n/2) + n, T(1)=1
(ii) T(n)= T(n−1) + n, T(1)=1State and explain the Master’s Theorem. Apply it to solve the following recurrence relation: T(n)=3T(n/2)+n
Describe the Merge Sort algorithm with a suitable example. Derive its time complexity using recurrence relations.
Apply the Binary Search algorithm to find the key 41 in the sorted array [5,12,18,25,33,41,56,63,70]
Also analyze its time complexity.
Apply the Heap Sort algorithm to the array. [16, 14, 10, 8, 7, 9, 3, 2, 4, 1]. Show the initial heap, each deletion step, and the final sorted array. Also analyse the time complexity.
Compare Greedy, Dynamic Programming, and Backtracking approaches with respect to solution strategy, efficiency, and applicability.
A thief has a knapsack of capacity 50 kg. The items available are given below. Apply the Fractional Knapsack Algorithm to select items (or fractions) that maximize total value, and compute the total weight and total value in the knapsack.
Item Weight (kg) Value ($) 1 10 60 2 20 100 3 30 120 4 15 75 5 25 80 6 18 90 7 12 48 8 8 32 Explain why this approach guarantees an optimal solution for the fractional knapsack problem.
Apply Bellman Ford’s algorithm step-by-step on the given weighted matrix W to compute single-source shortest paths from node 3. State the time complexity of the algorithm.
1 2 3 4 5 1 0 1 8 1 4 2 1 0 12 4 9 3 8 12 0 7 3 4 1 4 7 0 2 5 4 9 3 2 0
Discuss Dijkstra’s algorithm in detail with the help of an example. Explain why the algorithm fails for graphs containing negative edge weights. Also, state the time complexity of Dijkstra’s algorithm.
Discuss the Dynamic Programming approach for solving the Fibonacci series problem. Explain how it improves efficiency over the recursive method.
Given the distance matrix for 5 cities shown below, apply the Dynamic Programming approach to solve the Travelling Salesman Problem. Find the minimum cost tour starting and ending at City 1 and list the optimal tour. Show the key steps involved in computing the solution.
1 2 3 4 5 1 0 10 15 20 25 2 10 0 35 25 30 3 15 35 0 30 20 4 20 25 30 0 15 5 25 30 20 15 0 Given the directed graph G(V,E) with vertices V= {1, 2, 3, 4, 5} and edges E= {(1, 2), (1,3),(2,4),(3,4),(4,5)}:
(i)Represent the graph using an adjacency matrix.
(ii) Represent the same graph using an adjacency list.
What is a strongly connected component? Find all the strongly connected components in the following graph. Show all necessary steps and data structure values of the algorithm.

What is P, NP, NP hard, and NP complete? Write the relationship between all of them.
Huffman Coding Algorithm
Heuristics
BFS vs DFS
Cook’s theorem
