by an algorithm is equal to the sum of the following two components: A fixed part is defined as the total space required to store certain data and variables for an algorithm. For example, simple variables and constants used in an algorithm. A variable part is defined as the total space required by variables, which sizes depends on the problem and its iteration. For example: recursion used to calculate factorial of a given value n.
Efficiency of an algorithm . Computer resources are limited that should be utilized efficiently. The efficiency of an algorithm is defined as the number of computational resources used by the algorithm. An algorithm must be analyzed to determine its resource usage.
The efficiency of an algorithm can be measured based on the usage of different resources. For maximum efficiency of algorithm we wish to minimize resource usage. The important resources such as time and space complexity cannot be compared directly, 12th Computer Chapter - - Algorithmic Strategies so time and space complexity could be considered for an algorithmic efficiency. .
. Method for determining Efficiency The efficiency of an algorithm depends on how efficiently it uses time and memory space. The time efficiency of an algorithm is measured by different factors. For example, write a program for a defined algorithm, execute it by using any programming language, and measure the total time it takes to run.
The execution time that you measure in this case would depend on a number of factors such as: • Speed of the machine • Compiler and other system Software tools • Operating System • Programming language used • Volume of data required However, to determine how efficiently an algorithm solves a given problem, you would like to determine how the execution time is affected by the nature of the algorithm. Therefore, we need to develop fundamental laws that determine the efficiency of a program in terms of the nature of the underlying algorithm. A way of designing algorithm is called algorithmic strategy . .
Space-Time tradeoff A space-time or time-memory tradeoff is a way of solving in