0% found this document useful (0 votes)
16 views

btech-cs-5-sem-design-and-analysis-of-algorithm-ncs501-2021

Uploaded by

debojeetmitra04
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)
16 views

btech-cs-5-sem-design-and-analysis-of-algorithm-ncs501-2021

Uploaded by

debojeetmitra04
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/ 1

Printed Page: 1 of 1

Subject Code: NCS501


0Roll No: 0 0 0 0 0 0 0 0 0 0 0 0 0

B. TECH.
(SEM-V) THEORY EXAMINATION 2020-21
DESIGN AND ANALYSIS OF ALGORITHMS
Time: 3 Hours Total Marks: 100
Note: Attempt all Sections. If require any missing data; then choose suitably.
SECTION A
1. Attempt all questions in brief. 2 x 10 = 20
a. What is a recursion? Compare recursive programs with iterative programs
b. Determine asymptotic order of the function f(n)=2 n+5n+3
c. Define Red Black trees and state their application.
d. What do you understand by stable sort?
e. Prove that maximum degree of any node in n node binomial tree is log n.
f. Compute the prefix function for the pattern “abababca”.
g. Discuss B tree properties in brief.
h. What is an optimization problem?
i. What is the importance of average case analysis of algorithm?
j. Discuss randomized algorithm.
SECTION B
2. Attempt any three of the following: 10x3=30
a. Show the steps in Heap sort to arrange the following dada in non decreasing order { 11, 5,
32, 41, 67,21, 4, 27, 64, 11, 5}
b. Show the R-B-Tree that results after successively inserting 10, 9, 8,7,6,5,4,3,2 and 1 into an
initially empty Red-Black Tree.
c. Differentiate between Backtracking and Branch & Bound method? Discuss 0/1 Knapsack
problem with respect to Backtracking.
d. Write Breadth First Traversal algorithm for any graph. Derive its time complexity. How
time complexity of this is different from Depth First Search.
e. Write Knuth-Morris-Pratt algorithm for sting matching. Also discuss its time complexity.
SECTION C
3. Attempt any one part of the following: 10x1=10
a. Sort the following sequence using quick sort {22, 44, 33, 11, 77, 66, 55, 88, 100}
b. Solve the following recurrence: (i) T (n) = 4T(n/2) + n2 ; (ii) T (n) = T (n/4) + T (n/2) + n2
4. Attempt any one part of the following: 10x1=10
a. Write an algorithm for insertion in Fibonacci Heaps. Also discuss amortized analysis for
Extract Min operation in Fibonacci Heaps.
b. Explain and write an algorithm for union of two binomial heaps and write its time
complexity?
5. Attempt any one part of the following: 10x1=10
a. What is Activity Selection problem? Write a greedy approach to solve Activity Selection
problem.
b. When and how dynamic programming approach is applicable? Discuss the matrix chain
multiplication problem with respect to Dynamic programming.
6. Attempt any one part of the following: 10x1=10
a. Show how to compute transitive closure of a graph using Floyd Warshal algorithm for all
pair shortest paths.
b. Write & explain Kruskal algorithm to find minimum spanning tree for a graph with suitable
example.
7. Attempt any one part of the following: 10x1=10
a. Discuss (i). NP complete problem. (ii). Approximation Algorithm
b. Discuss String matching algorithm. Explain naive string-matching algorithm for the text T=
abcaabccaabbabca and pattern P= abc.

Page 1 of 1

You might also like