Sunteți pe pagina 1din 2

SANKALCHAND PATEL COLLEGE OF ENGINEERING, VISNAGAR B.E.

SEMESTER V (CE) DESIGN & ANALYSIS OF ALGORITHMS

ASSIGNMENT I

1. Describe the method for analyzing an algorithm. What do you mean by best case, average case, and worst case time complexity of an algorithm? 2. Devise an algorithm which maintains telephone directory of your friends. List the names of your friends in the lexicographical order. 3. Consider the following list of elements: 70, 80, 40, 50, 60, 11, 35, 85, 2 Sort the above list using Merge sort, Bubble sort, and Insertion sort. In above techniques which sorting technique is the best in worst case? Support your argument with an example and analysis. 4. Define the following terms: a) Big oh Notation (O) b) Big theta Notation () c) Big Omega Notation ()

d) Little oh Notation (o) e) Little Omega Notation ()

5. Find the Big oh (O), Big Theta (), Big Omega (), Little oh (o), and Little omega () Notation for the following functions. a) f(n) = 14 * 6 + 25 d) f(n) = 70n3 + 35n2 + 45 n b) f(n) = 6n + 10 * 20 e) f(n) = 3*2 + 58n2 + 39 2 c) f(n) = 69n + n + 35 6. Prove that following are Incorrect Bounds. a) 7n3 + n O(n2) b) 7n + 3 O(1) c) 7n3 + n2 (n4) 7. Prove that the following are the loose bounds. a) 7n3 + n2 = O(n4) b) 7n + 3 = O(n2) 8. Prove if f(n) = am n
m

d) e) f) c) d)
+

7n + 3 (n2) 7n + 3 (n4) 7n + 3 (n2) 7n3 + n2 = (n2) 7n + 3 =


m m

(1)

+ am-1 n

m-1

+ + a1n

a0, and a >0, then f(n)=(n ). = C. Prove

9. If f(n) and g(n) be such that for some constant c that 0 < c < .

exists, then function f (g), if

10. Arrange the following growth rates in the increasing order: O (n3), O (1), O (n2), O (n log n), O (n2 log n), (n0.5), (n log n), (n3), (n0.5)

V-CE-DAA-Assignment-I

SANKALCHAND PATEL COLLEGE OF ENGINEERING, VISNAGAR B.E. SEMESTER V (CE) DESIGN & ANALYSIS OF ALGORITHMS

ASSIGNMENT II
1. Multiply the Large Integers with the Divide and Conquer algorithm. 2. Describe the procedure for matrix multiplication with example. 3. Apply the divide and conquer algorithm on merge sort and quick sort. 4. What is activity selection problem ? 5. Discuss the minimum spanning trees. 6. Explain the knapsack and job scheduling problem. 7. What is making a change problem ? 8. Differentiate the NP-Hard and NP-complete problem. 9. What is polynomial reduction ?

V-CE-DAA-Assignment-I

S-ar putea să vă placă și