Analysis and Complexity of an Algorithm
As discussed an Algorithm is defined as “An algorithm is a step-by-step
finite sequence of instructions to solve a particular problem.”
The analysis of algorithm is performed to calculate the efficiency of an
algorithm.
The efficiency of an algorithm is measured on the basis of the
performance of the algorithm.
We can measure the performance of an algorithm by computing two
factors:
1. Amount of time required by an algorithm to execute
(Time Complexity).
2. Amount of space required by an algorithm (Space Complexity).
Time Complexity means CPU Time
Space Complexity means space allocated in main memory or RAM
So which is more important?
Time Complexity is more important than Space Complexity