Daa Assignment1
Daa Assignment1
Asymptotic Notations
7. Explain asymptotic notations Big O, Big Ω and Big θ that are used to compare the order of
growth of an algorithm with example
8.
Prove the following statements. d. 100n + 5 =`O(n2)
2 2 2 3
a. n + 5n + 7 = Θ(n ) e. n + n = O(n )
2 2 2
b. 2 ½ n(n-1) 2= Θ(n ) f.3 5n2 + 3n +2 20 = O(n )
c. ½ n +3n= Θ(n ) g. n + 4n = Ω(n )
Mathematical Analysis of Non-Recursive Algorithms
9. Explain general plan of mathematical analysis of non-recursive
algorithms with example.
10. Write the algorithm to find maximum element in the given array and explain the
mathematical analysis of this non-recursive algorithm
11. Write the algorithm to check whether all the elements in the given array are distinct and
explain the mathematical analysis of this non- recursive algorithm. Derive its worst-case
time complexity
12. Write the algorithm to perform matrix multiplication and explain the mathematical
analysis of this non-recursive algorithm
Mathematical Analysis of Recursive Algorithms
13. Explain general plan of mathematical analysis of recursive algorithms
with example.
14. Illustrate mathematical analysis of recursive algorithm for Towers of
Hanoi OR Give the recursive algorithm to solve Tower of Hanoi problem. Show that the efficiency
of this algorithm is exponential
15. Illustrate mathematical analysis of recursive algorithm to find the
factorial of a given number
16. State the recursive algorithm to count the bits of a decimal number in its binary
representation. Give its mathematical analysis