In Progress
Lesson 3 of 43
In Progress

Analysis Framework

Akash

Once the algorithm is built, the next step is to analyze how efficient the algorithm is ?

In order to analyze the algorithm, we actually consider two parameters.

TIME & SPACE

We measure efficiency of an algorithm in terms of how fast it runs (executes) and we refer to it as time efficiency.

And we also measure efficiency of an algorithm in terms of how much extra (more) space the algorithm requires to run(executes).

Time efficiency can be analyzed on following 2 factors:

1)Based on number of inputs the algorithm accepts.

It is known fact that as number of inputs given to the algorithm increases , the consumed to execute the same would also increase .

For Example, it always takes a longer time to solve a tower of Hanoi problem with 5 discs when compared it with 3 discs

2)Measuring Unit of Time.

An Algorithm running time can be measured in several units of time

For Example, we may use a few standard units such as milliseconds, microseconds etc.

But we have drawbacks with these units such as speed of computer , the programming language used to implement the algorithm etc.,makes it difficult to measure algorithms efficiency . we would like to have a parameter (unit) which does not depend on above factors.

#ONE WAY IS TO COUNT THE NUMBER OF TIMES THE BASIC OPERATION IS EXECUTED.

Hence , the time efficiency is analyses by determining the number of times the basic operation is repeated as a function of input size (number of inputs accepted)

i.e.  T(n) ≈ Cop C(n)

Where,

T-> running time   Cop->Execution time of basic operation

C->number of times basic operation is executed    n->size of input.