1-030080503 (2013-14) Summer 2017

You might also like

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

UKA TARSADIA UNIVERSITY

B.Tech (CE)/B.Tech (IT) ( Semester 5 )


030080503(2013-14)/030090503(2013-14)
Design and Analysis of Algorithms
Date :29/05/2017 Time :1:30PM- 4:30PM
Max. Marks:60
Instructions :
1. Attempt all questions.
2. Write each section in a separate answer book.
3. Make suitable assumptions wherever necessary.
4. Draw diagrams/figures whenever necessary.
5. Figures to the right indicate full marks allocated to that question.
6. Follow usual meaning of notations/abbreviations.
SECTION - 1
Q 1 A) Answer the following in brief. (Any 2) [4]
I) What is the best case, average case and worst case time complexity to search a record from the
database?

II) Find the asymptotic tight bound for f(n)=27n2+16n+25. Also compute c and n .
0

III) Solve the recurrence using master method:


T(n)=4T(n/2) + (n2√n)

Q 1 B) Answer the following . (Any 1) [5]


I) Write selection sort algorithm and find it’s worst case time complexity.

II) Explain different asymptotic notations with equations.

Q 2 A) Answer the following in brief. (Any 2) [4]


I) Write binary search algorithm using divide and conquer technique.

II) Write the recurrence relation for Strassen’s matrix multiplication using divide and conquer approach and
also find the time complexity.

III) Explain divide and conquer approach.

Q 2 B) Sort the list using quick sort algorithm: 9,6,5,0,8,2,4,7 (pivot: last element). [5]

OR
Q 2 B) Explain how divide and conquer method helps in multiplying two large integers and also find its run time
complexity.

Q 3 Answer the following in detail. (Any 2) [12]


I) Solve the following fractional knapsack problem. There are five items whose weights and values are
given in following arrays:
Weight w[] = {2,4,6,8,12}
Value v[] = {6,11,15,25,28}. Find the optimal knapsack items for weight capacity of 25 units.

II) Differentiate knapsack problem solving using greedy method and dynamic programming.

III) Generate minimum spanning tree for the following graph using Prim’s algorithm. Starting vertex is 1.
SECTION - 2
Q 4 A) Answer the following in brief. (Any 2) [4]
I) Draw finite automata for pattern "abab" and input alphabet ∑={a,b}.

II) Explain spurious hit in Rabin-Karp string matching algorithm.

III) Explain MinMax principle.

Q 4 B) Solve the following instance of the assignment problem using branch and bound algorithm. [5]

OR
Q 4 B) Write a short note on finite automata for string matching with an example.

Q 5 A) Answer the following in brief. (Any 2) [4]


I) Define: sparse graph, dense graph
II) Explain adjacency-matrix representation of graph.
III) Explain postorder traversal with an example.

Q 5 B) Illustrate the progress of depth-first search on the graph given below. Here, 1 is the starting vertex. [5]

OR
Q 5 B) Explain how knapsack problem can be solved using backtracking with an example.

Q 6 Answer the following in detail. (Any 2) [12]


I) Find an optimal parenthesization of a matrix-chain product whose sequence of dimensions is <10, 3, 5,
9, 12, 5>.
II) Write a short note on assembly line scheduling.
III) Apply Floyd's algorithm to find shortest path between all pair of nodes for the graph given below.

You might also like