An Algorithm a Day

Every operation in computers takes a finite time and energy, no matter how small. The primary reasons for the birth and evolution of algorithms is to minimize time and energy requirements. But in order to understand the time and energy we need to look at the data which has the following variables:

  1. Data Complexity: Sorted or Unsorted
  2. Data Size: The amount of data

Once we have the variables we can calculate the cost of using an algorithm. But in order to do that we need:

  1. Sample data sets with variable complexity and size
  2. An implementation of algorithm

And even if we have these two, we can never be sure that we have tested our algorithm perfectly.

So in order to test an Algorithm we make use of mathematical models which help in understanding the following:

  1. Process time for each individual part of algorithm
  2. Increase of time with data complexity
  3. Increase of memory footprint with data complexity

And since the mathematical models are primarily an equation, we can control the variables. The variables are grown in following manner:

  1. Constant :
  2. Logarithmic :
  3. Linear :
  4. Linearithmic :
  5. Quadratic :
  6. Cubic :
  7. Exponential :

This give better insights into the capabilities of algorithm over scale.