0% found this document useful (0 votes)
43 views4 pages

Dec 2019 CS302 - Design and Analysis of Algorithms (S) - Ktu Qbank

Uploaded by

kuldeep kumar
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)
43 views4 pages

Dec 2019 CS302 - Design and Analysis of Algorithms (S) - Ktu Qbank

Uploaded by

kuldeep kumar
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/ 4

A F192010 Pages:4

Reg No.:_______________ Name:__________________________

APJ ABDUL KALAM TECHNOLOGICAL UNIVERSITY


SIXTH SEMESTER B.TECH DEGREE(S) EXAMINATION(S), DECEMBER 2019
Course Code: CS302
Course Name: DESIGN AND ANALYSIS OF ALGORITHMS
Max. Marks: 100 Duration: 3 Hours
PART A
Answer all questions, each carries3 marks. Marks

1 Analyse the complexity of the following function (3)


void function(int n)
{ int count = 0;
for (int i=n/2; i<=n; i++)
for (int j=1; j<=n; j = 2 * j)
for (int k=1; k<=n; k = k * 2)
count++;
}
2 Solve using Iteration method T(n)=2T(n/2)+n,T(1)=1 (3)
3 Define B-tree. Discuss the significance of B-tree (3)
4 Explain Asymptotic notations in algorithm analysis (3)

PART B
Answer any two full questions, each carries9 marks.
5 a) Solve using Recursion Tree method (5)
2
T(n)=3T(n/4)+n
b) Analyse the complexity of the following functions (4)
i)function(int n)
{ if (n==1) return;
for (int i=1; i<=n; i++)
{ for (int j=1; j<=n; j++)
{ printf("*"); break; }
}
}
ii) void function(int n)
{
int i = 1, s =1;
while (s <= n)
{
i++;
s += i;
printf("*");
}
}

Page 1 of 4

For More Visit : KtuQbank.com


A F192010 Pages:4

6 a) Construct a Red Black tree by inserting 10,20,30,15,16 and 27 into an initially (9)
empty tree and also delete 15,16 and 30 from the tree
7 a) Solve using Masters theorem (5)
i) T(n)=2T(n/4)+√n
ii) T(n)=7T(n/2)+ n2
b) Explain AVL rotations with examples (4)

PART C
Answer all questions, each carries3 marks.
8 Define spanning tree of a graph. Write the total number of spanning trees possible (3)
for a complete graph with 6 vertices.
9 Write the applications of BFS and DFS (3)
10 List and explain the characteristic properties associated with a problem that can be (3)
solved using dynamic programming.
11 Explain Divide and Conquer strategy. (3)

PART D
Answer any two full questions, each carries9 marks.
12 a) What are different classification of edges that can be encountered during DFS (4)
operation and how it is classified? Explain with example
b) Find strongly connected components of the digraph using the algorithm showing (3)
each step

c) Write the topological sorting for the DAG given below (2)
4
3
5

1
6
2

Page 2 of 4

For More Visit : KtuQbank.com


A F192010 Pages:4

13 a) Given a chain of 4 matrices <A1,A2,A3,A4> with dimensions (5)


<5X4>,<4X6>,<6X2>,<2X7> respectively. Using Dynamic programming find the
minimum number of scalar multiplications needed and also write the optimal
multiplication order.
b) Write down Bellman Ford algorithm and analyse the complexity .What is the time (4)
complexity of Bellman-Ford single-source shortest path algorithm on a complete
graph of n vertices?
14 a) Write a short note on graph traversals (2)

Perform BFS traversal on the above graph starting from node A. If multiple node (2)
choices may be available for next travel, choose the next node in alphabetical order.

b) Explain Strassen’s matrix multiplication and analyse its complexity (5)


PART E
Answer any four full questions, each carries10 marks.
15 a) Give a comparison between dynamic programming and Divide and conquer (4)
strategy
b) Apply Prim’s algorithm on the following graph. Let A be the source vertex (6)

16 a) Formulate Fractional Knapsack Problem. Write Greedy Algorithm for fractional (5)
Knapsack Problem.
b) Find the optimal solution for the following fractional Knapsack problem. Given (5)
number of items(n)=4, capacity of sack(m) = 60, W={40,10,20,24} and
P={280,100,120,120}
17 a) Define NP hard and NP-Complete problems (4)
b) Write short notes on Polynomial time reductions with example (4)
c) Define class P and class NP (2)

Page 3 of 4

For More Visit : KtuQbank.com


A F192010 Pages:4

18 a) Define Travelling Salesman Problem (TSP). Explain the basic steps that are to (10)
be followed to solve TSP using branch and bound with an example.
19 a) Write the Kruskal’s algorithm for finding minimum cost spanning tree and explain (7)
the Kruskal’s algorithm with an example. Analyse the complexity of the algorithm.
b) Explain greedy strategy (3)
20 a) State and explain N-queens problem (2)
b) Draw the state space tree of 4-queens problem (5)
c) Define backtracking strategy (3)
****

Page 4 of 4

For More Visit : KtuQbank.com

You might also like