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

CS2006-1

The document outlines the structure and content of the End-Term Summer/Supplementary Examination for the Design and Analysis of Algorithms course at the National Institute of Technology, Rourkela. It includes various questions covering topics such as recurrence relations, dynamic programming, greedy algorithms, backtracking, and optimization problems. Each question requires detailed answers and algorithms, with a total of 50 marks allocated for the examination.

Uploaded by

srk712906
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)
3 views2 pages

CS2006-1

The document outlines the structure and content of the End-Term Summer/Supplementary Examination for the Design and Analysis of Algorithms course at the National Institute of Technology, Rourkela. It includes various questions covering topics such as recurrence relations, dynamic programming, greedy algorithms, backtracking, and optimization problems. Each question requires detailed answers and algorithms, with a total of 50 marks allocated for the examination.

Uploaded by

srk712906
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

NATIONAL INSTITUTE OF TECHNOLOGY, ROURKELA

END-TERM SUMMER / SUPPLEMENTARY EXAMINATION - 2023


ANSWER ANY FIVE QUESTIONS
All Parts of a question should be answered at one place.
SUBJECT: Design and Analysis of Algorithm Subject Code: CS2006
FULL MARKS : 50 Duration of Examination: 3 Hours

1[a] Solve the following recurrence relation assuming N as an integer power of 2


T(n) = 1 ; n=1
T(n) = 7T(n/2) + n ; n2
1[b] Show that the following equation is correct: 33n3 + 4n2 = O(n3)?
1[c] What is reducibility in the context of NP-completeness?
1[d] How does the Dynamic Programming paradigm differs from the Greedy paradigm?
1[e] Show that two (large) n-digit integers can be multiplied in O( n1.585 )?
[2×5]
2[a] What is the pre-condition for performing a binary search in a linear array? Write the
algorithm of binary search. Modify binary search so that it always returns the smallest
(largest) index of a key of an item matching the search key. Write the recurrence relation
to find the best case, average case and worst-case time complexity of your algorithm?
Comment on the space complexity and limitation of binary search algorithm.

2[b] Write an algorithm to solve the make-change problem using dynamic programming?
Suppose there are n types of coin denominations, d1, d2, …, and dn. (We may assume one of
them is penny.) There are infinite supplies of coins of each type. The problem is to make
change for an arbitrary amount j using the minimum number of coins. Comment on time
and space complexity of the algorithm
[5+5]
3[a] What is a randomized algorithm? Design a randomized algorithm rsearch(A, n, x) which will
search whether x is in the array A of n elements. If found it will terminate. Otherwise, the
algorithm is guaranteed to terminate when it finds that none of the elements in A is x.
What is the time complexity of your algorithm?

3[b] Write a divide-conquer recursive algorithm "MaxMin" to find the maximum and minimum
from a set of n elements. Modify Algorithm "MaxMin" so that it works when n is not a
power of 2. Is the number of comparisons performed by the new algorithm 3n/2-2, even
if n is not a power of 2?
[5+5]
4[a] Express, finding minimum spanning tree of an undirected connected graph as an
optimization problem. Kruskal’s algorithm for finding a minimum spanning tree employs a
minheap to store the candidate edges. If a graph has m edges, explain why the time
complexity for this algorithm must be O(m logm). In Kruskal's method for finding a
minimum spanning tree, how does the algorithm know when the addition of an edge will
generate a cycle?

Page 1 of 2
4[b] Write the control Abstraction for Divide-and-Conquer paradigm? Write the recurrence
relation to compute the time taken by a Divide and Conquer algorithm, to solve defective
chessboard problem with size [2K  2k, with k  0]? Solve the recurrence relation using
telescopic sum method.
[5+5]
5[a] Define the principal of optimality? Explain the basic 4-step process to solve optimization
problem under dynamic programming paradigm? Use LCS problem to explain this 4-step
process with appropriate algorithm?

5[b] Formulate the container loading as an optimization problem. Suggest a greedy algorithm to
find solution to the container loading. Suppose you have 6 containers whose weights are
45, 10, 30, 20, 55, and 5 and a ship whose capacity is 100. Use the algorithm to find a
greedy solution to this instance of the container loading problem.
[5+5]
6[a] What are the main steps of a backtracking algorithm? What is a dead-end in backtracking?
State the different constraints to be satisfied while solving an optimization problem using
backtracking. Discuss how BACKTRACKING is used to solve the 4-queens problem where
solution space is organized as a tree.

6[b] Discuss the structure of the knapsack problem? Explain how this problem can be solved
using Dynamic programming. Find an optimal solution the knapsack problem with instance
n =8, m=20 with ( P1, P2, .., P7, P8 ) = (10, 5, 15, 7, 6, 18, 3,2) and (w1, w2, … , w7, w8) = (2, 3,
5, 7, 1, 4, 2,1).
[5+5]
7[a] Show that average time complexity of "QuickSort" is (n log n)? Show that work space
needed by Algorithm "QuickSort" varies between (log n) and (n)? What is its average
space complexity?
7[b] Suppose that we want to multiply four matrices, A, B, C, D, of dimensions 5020, 201, 1
10, and 10 100, respectively. Multiplying an mn matrix by an np matrix takes mnp
multiplications. Determine the optimal order, if we want to compute ABCD using
dynamic programming paradigm. Create two tabular representation to find out minimum
multiplication required and parenthesizations of the matrix chain.
[5+5]
8[a] Define and differentiate between deterministic and non-deterministic algorithm? Suggest a
non-deterministic primality testing algorithm? What is the time complexity of the proposed
algorithm?
8[b] Explain the generic method for branch and bound algorithms. How does branch and bound
method solve the 0/1 Knapsack problem? Use the following instance n = 5, (p1, p2, p3, p4,
p5) = (10,15, 6, 8, 4), (w1, w2, w3, w4, w5) = (4, 6, 3, 4, 2), and m = 12 to explain branch and
bound algorithm. Will the branch and bound algorithm perform better that the dynamic
programming solution? Justify.
[5+5]

--------------------------------------- Good luck ---------------------------------------

Page 2 of 2

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy