Assignment 1
Assignment 1
9. Time complexity of –
12. Write recurrence relation for the recursive function that prints Fibonacci series.
Solve the recurrence relation to get time complexity of the program. What will be the
space complexity of this program and why?
14. Solve the following recurrence relation T(n) = T(n/4) + T(n/2) + cn^2
15. What is the time complexity of following function fun()?
17. Write a recurrence relation when quick sort repeatedly divides the array in to two
parts of 99% and 1%. Derive the time complexity in this case. Show the recursion tree
while deriving time complexity and find the difference in heights of both the extreme
parts. What do you understand by this analysis?
19. Write recursive/iterative pseudo code for binary search. What is the Time and Space
complexity of Linear and Binary Search (Recursive and Iterative)