Noida Institute of Engineering and Technology, Greater Noida

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

Noida Institute of Engineering and Technology, Greater Noida

Printed Page: - Sub Code: KCS503


Paper Id: Roll No.:

Pre-University Test (Online)


B. TECH.-V Semester
ODD THEORY EXAMINATION 2020-21
Design and Analysis of Algorithm
Time: 3 Hours Total Marks:100
Note: 1. Attempt all Sections.
SECTION-A
1. Attempt all questions in brief. 2 x 10 = 20
Q.No. Question Marks CO
a. Define algorithm. List the desirable properties of an algorithm. 2 CO1
b. Write the advantages of insertion sort. 2 CO1
c. Describe the properties of Red-Black tree. 2 CO2
d. Define and discuss the properties of B-tree. 2 CO2
e. Explain greedy algorithms by quoting a suitable example. 2 CO3
f. What do you understand by divide and conquer approach for designing algorithm. 2 CO3
What are the advantages of this approach in algorithm design?
g. Explain the application of graph coloring problem. 2 CO4
h. Explain travelling salesman problem in detail. 2 CO4
i. Define P and NP problems. 2 CO5
j. Explain approximation algorithm by quoting an example. 2 CO5

SECTION-B
2. Attempt any three of the following: 3 x 10 = 30
Q.No. Question Marks CO
a. Define Big O notation, Big Omega and Big Theta Notation. Depict the same 10 CO1
graphically and explain.
b. Show the results of inserting the following keys into an empty B-tree with 10 CO2
minimum degree t= 2,
T, V, W, M, R, N, P, A, B, X, Y, D, Z, E, F, S, Q, K, C, L, H
c. Write and explain Dijkstra’s algorithm and apply it on the graph given 10 CO3

1|Page
d. Write the algorithm for finding all pair shortest path in a graph. Apply this 10 CO4
algorithm on the graph given in part [2-(c)]. What is the complexity of this
algorithm? Which design strategy the algorithm uses?
e. Write and explain Rabin Karp string matching algorithm. Working modulo q =13, 10 CO5
how many spurious hits does the Rabin-Karp matcher encounter in the text T
= 3141592653589793 when looking for the pattern P = 35?

SECTION-C

3. Attempt any one part of the following: 1 x 10 = 10


Q.No. Question Marks CO
a. Write the algorithm for quick sort. Provide a complete analysis of quick sort for 10 CO1
the given set of numbers 11, 33, 24, 40, 45, 20, 5, 2, 13
b. Write the algorithm for counting sort. Apply this algorithm on the following data: 10 CO1
A=[8, 3, 2, 5, 3, 7, 2, 4, 6, 8, 1]
What is the complexity of counting sort?

4. Attempt any one part of the following: 1 x 10 = 10


Q.No. Question Marks CO
a. i) Prove that the maximum degree of any node in an n-node binomial tree is log n. 10 CO2
ii) Write an algorithm for merging two Fibonacci heaps.
b. Write and prove the properties of binomial trees, also write an algorithm for 10 CO2
merging/union two binomial heaps.

5. Attempt any one part of the following: 1 x 10 = 10


Q.No. Question Marks CO
a. Write the algorithm for finding Huffman codes. Find and optimal Huffman code for the 10 CO3
following set of frequencies.
a: 2 b: 8 c: 8 d: 15 e: 1 f: 13 g:20 h:13
b. Use the Prim’s Algorithm to find the MST of the following given graph 10 CO3

6. Attempt any one part of the following: 1 x 10 = 10


Q.No. Question Marks CO

a. Solve the following instance of 0/1 knapsack. 10 CO4


Items = (1, 2, 3, 4, 5), Wt = (2, 4, 3, 4, 1), Profit = (3, 5, 4, 8, 3).
Assume capacity of knapsack W = 8.

2|Page
b. Write short notes on: 10 CO4
i) Backtracking
ii) Hamiltonian Cycles

7. Attempt any one part of the following: 1 x 10 = 10


Q.No. Question Marks CO
a. Explain Strassen's algorithm. What is the complexity of this algorithm? 10 CO5
Use Strassen's algorithm to compute the matrix product

b. What is the application of Fast Fourier Transform (FFT)? Also write the recursive 10 CO5
algorithm for FFT.

3|Page

You might also like