CSA06 - Model - Exam - 2024 - Set-1
CSA06 - Model - Exam - 2024 - Set-1
5. 10 CO3 BTL-5
show the intermediate matrices, and analyze the time complexity of the algorithm.
b) For the string "BBABCBCAB", find the length of the longest palindromic
subsequence
Given a graph with 5 vertices and the following edge list with weights, find the
shortest path from vertex 0 to all other vertices using Bellman-Ford Algorithm:
6. 10 CO3 BTL-2
{(0,1,6),(0,2,7),(1,2,8),(1,3,5),(1,4,−4),(2,3,−3),(2,4,9),(3,1,−2),(4,3,7)}\{ (0, 1, 6),
(0, 2, 7), (1, 2, 8), (1, 3, 5), (1, 4, -4), (2, 3, -3), (2, 4, 9), (3, 1, -2), (4, 3, 7) }
a) Given weights [2, 3, 4, 5] and values [3, 4, 5, 6] with a knapsack capacity of 5,
find the maximum value that can be obtained using the 0/1 knapsack problem
approach. Show the DP table construction.
7. 10 CO4 BTL-3
b) Given characters with frequencies as follows: [(A, 5), (B, 9), (C, 12), (D, 13),
(E, 16), (F, 45)], construct the Huffman tree and determine the Huffman codes
for each character. Show the process.
a) Use Boruvka's algorithm to find the minimum spanning tree for the following
8. 10 CO4 BTL-3
graph edges with weights: {(A,B,1),(A,C,2),(B,D,4),(C,D,6),(C,E,3),(D,E,5)}
Show each step of the process.
b) Analyze the performance of the greedy algorithm in solving the coin change
problem for coin denominations [1, 3, 4] and target amount 6. Explain why it
succeeds or fails.
Provide a valid solution for the 8-Queens problem by placing 8 queens on an 8x8
9. chessboard such that no two queens attack each other. Show the final board 10 CO5 BTL-4
configuration.
Given a graph with vertices {A, B, C, D} and edges {(A, B), (A, C), (B, C), (B,
10. 10 CO5 BTL-5
D)}, find a maximum cut using a greedy algorithm. Show each step of the process.