You are on page 1of 1

Assignment#1

1. Explain the various features and performance measures of an algorithm. 2. Briefly explain asymptotic analysis of a function with the help of Stirling's approximation. 3. How we measure time complexity for: a. For loop b. While loop c. If and else d. Arithmetic and logical operation 4. Explain the difference between time complexity and space complexity with suitable example. 5. Briefly explain the following concept related with space complexity: a. DSPACE b. NSPACE c. PSPACE d. Savitchs Theorem e. Emermons Theorem f. TQBF (True quantified Boolean formula problem) 6. Write pseudo code for Merge Sort Using a loop invariant prove that your algorithm is correct. 7. Suppose you are given k sorted arrays, each with n elements, and you want to combine them into a single array of kn elements. Consider the following approach. Using the merge algorithm of merge sort, you merge the first 2 arrays, then merge the 3rd given array with this merged version of the first two arrays, and so on until you merge in the final (kth ) input array. What is the time taken for this strategy, as a function of k and n? 8. Prove that lg(n!) = (n lg n) and that n! = o(nn) 9. Show that for any real constants a and b, where b>0, 10. Is 2 n + 1 = O(2 n )? Is 2 2n = O(2 n )? 11. Using the substitution method show that the solution of the recurrence T(n) = 2 T( n/2 + 17) + n is T(n) = O(n lg n) 12. Solve the recurrence T(n) = 2T( n ) +1 by making a change of variables. 13. Use a recursion tree to determine a good asymptotic upper bound on recurrence T(n) = 3T( n/2) + n. Use substitution to verify your answer. 14. Can the master method be applied to recurrence T(n) = 4 T(n/2) + n2 lg n Why or why not? 15. Explain Divide and conquer method using quick sort. 16. Explain various properties of Binary search tree. 17. Explain priority queues using heap. 18. Deduce time complexity of Strassens Matrix Multiplication using divide and conquer method. (n+a)b = (nb).

You might also like