Introduction to Algorithms : Time Complexity
Print this page
     
  • To measure the time complexity in absolute time unit has the following problems
  1. The time required for an algorithm depends on number of instructions executed, which is a complex    polynomial.
  2. The execution time of an instruction depends on computer's power. Since, different computers take    different amount of time for the same instruction.
  3. Different types of instructions take different amount of time on same computer.
  • Complexity analysis technique abstracts away these machine dependent factors . In this approach, we assume all instruction    takes constant amount of time for execution.
  • Asymptotic bounds as polynomials are used as a measure of the estimation of the number of instructions to be executed by the algorithm . Three main types of asymptotic order notations are used in practice:
 
1.
 
- notation : For a given function g(n), is defined as
   
 

In other words, a function is said to belong to , if there exists positive constants and such that for sufficiently large value of n. For example, . This is because we can find constants such that , for all .

Prev