Design and Analysis of Computer Algorithm Lecture 1



Download 1.12 Mb.
Page10/10
Date21.10.2021
Size1.12 Mb.
#57544
1   2   3   4   5   6   7   8   9   10
notes lec1

Estimating Running Time

  • Algorithm arrayMax executes 6n  1 primitive operations in the worst case.
  • Define:
  • Let T(n) be worst-case time of arrayMax. Then a (6n  1)  T(n)  b(6n  1 )
  • Hence, the running time T(n) is bounded by two linear functions
  • Thursday, October 21, 2021

Growth Rate of Running Time

  • Analysis of Algorithm
  • Thursday, October 21, 2021

Function of Growth rate

  • Thursday, October 21, 2021
  • Analysis of Algorithm

Big-Oh Notation

  • Analysis of Algorithm
  • To simplify the running time estimation,
  • for a function f(n), we ignore the constants and lower order terms.
  • Example: 10n3+4n2-4n+5 is O(n3).
  • Thursday, October 21, 2021
  • FURTHER DISCUSSION
  • NEXT WEEK …………….
  • Thursday, October 21, 2021
  • Analysis of Algorithm

Download 1.12 Mb.

Share with your friends:
1   2   3   4   5   6   7   8   9   10




The database is protected by copyright ©ininet.org 2024
send message

    Main page