ADSENSE

Monday 16 February 2015

Determining The Efficiency of an Algorithm

The greatest difficulty in solving programming problems is not how to solve the problem, but how to solve the problem efficiently. Factors that effect the efficiency of a program include the speed of the machine, the compiler, the operating system, the programming language, and the size of the input. However, in addition to these factors, the way data of a program is organized, and the algorithm used the solve the problem also has a significant impact on the efficiency of a program.

There can be cases, where a number of methods and algorithm used to solve a problem. In such a situation, it can be difficult to decide which algorithm to use.

When there are several different ways to organize data and device algorithms, it becomes important to develop criteria to recommend a choice . Therefore, you need to study the behavior of algorithms under various conditions and compare their efficiency.

The efficiency of an algorithm can be computed by determining the amount of resources it consumes. The primary resources that an algorithm consumes are:
1. TIME: The CPU time required to execute the algorithm
2. SPACE: The amount of memory used by the algorithm for execution. The lesser resources that and                    algorithm uses, the more efficient it is.

Time/Space Tradeoff
To solve a given programming problem, many different algorithm may be used. Some of these algorithms may be extremely time-efficient and others extremely efficient.

No comments:

Post a Comment

Monday 16 February 2015

Determining The Efficiency of an Algorithm

The greatest difficulty in solving programming problems is not how to solve the problem, but how to solve the problem efficiently. Factors that effect the efficiency of a program include the speed of the machine, the compiler, the operating system, the programming language, and the size of the input. However, in addition to these factors, the way data of a program is organized, and the algorithm used the solve the problem also has a significant impact on the efficiency of a program.

There can be cases, where a number of methods and algorithm used to solve a problem. In such a situation, it can be difficult to decide which algorithm to use.

When there are several different ways to organize data and device algorithms, it becomes important to develop criteria to recommend a choice . Therefore, you need to study the behavior of algorithms under various conditions and compare their efficiency.

The efficiency of an algorithm can be computed by determining the amount of resources it consumes. The primary resources that an algorithm consumes are:
1. TIME: The CPU time required to execute the algorithm
2. SPACE: The amount of memory used by the algorithm for execution. The lesser resources that and                    algorithm uses, the more efficient it is.

Time/Space Tradeoff
To solve a given programming problem, many different algorithm may be used. Some of these algorithms may be extremely time-efficient and others extremely efficient.

No comments:

Post a Comment