1.12 Time Complexity

Common Time Complexities in ascending order of their growing time.

  1. >O(1): Constant time. Time does not increase at all.
  2. >O(logN): Logarithmic time. When time is increasing logarithmically (grows at inversely proportional rate of N).
  3. >O(N): Linear time. Time increases linearly with the input size.
  4. >O(NLogN): Linearithmic time. Logarithmic and Linear time together.
  5. >O(N**K): Polynomial time. When time increases at N (input) to the power K (constant) times.
  6. >O(K**N): Exponential time. When time increases at K (constant) to the power N (input) times.
    Note: Explaining all time complexities would consume lots of space for this book, you can read more about it here.