0% found this document useful (0 votes)
18 views2 pages

CSA06 - Model - Exam - 2024 - Set-1

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views2 pages

CSA06 - Model - Exam - 2024 - Set-1

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

SIMATS SCHOOL OF ENGINEERING

SAVEETHA INSTITUTE OF MEDICAL AND TECHNICAL SCIENCES

INSTITUTE OF COMPUTER SCIENCE AND ENGINEERING

PRELIMINARY MODEL EXAMINATION –JULY 2024


SUB CODE: CSA 06 SUBJECT NAME: DESIGN AND ANALYSIS OF ALGORITHMS

DURATION: 3 Hrs DATE: 01-07-2024 MARKS: 100 Marks

Answer All the Questions

Solve the recurrence relation T(n)=4T(n/2)+n2 using the Master Theorem.


1. 10 CO1 BTL-2
Confirm the result using the substitution method
For an algorithm with the worst-case time complexity T (n)=5nlogn+n, determine
2. its Big-O, Omega, and Theta notations. Provide a detailed proof and explanation 10 CO1 BTL-3
for each notation
a) Sort the array [20, 18, 12, 8, 5, -2] using both Selection Sort and Insertion Sort.
3. 10 CO2 BTL-2
Count the total number of comparisons and swaps for each algorithm.
a) Use the Median of Medians algorithm to find the median of the array [24, 36,
42, 18, 21, 30, 45, 50, 48]. Provide a detailed numerical example and analyze
the time complexity of the algorithm.
b) Multiply the following 2x2 matrices using Strassen’s algorithm:
[ [1, 1, 1, 1],
[2, 2, 2, 2],
A= [3, 3, 3, 3],
4. [2, 2, 2, 2] ] 10 CO2 BTL-4
[[1, 1, 1, 1],
[2, 2, 2, 2],
B= [3, 3, 3, 3],
[2, 2, 2, 2] ]
Count the number of multiplications and additions performed. Provide a
detailed numerical analysis comparing Strassen’s method with the standard
matrix multiplication.
a) Solve the all pairs shortest paths problem using Floyd's Algorithm for the
following adjacency matrix:

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.

You might also like