10

Click here to load reader

What is an algorithm?

Embed Size (px)

DESCRIPTION

Basic definition of algorithm

Citation preview

Page 1: What is an algorithm?

What is an algorithm?What is an algorithm?

Page 2: What is an algorithm?

DefinitionDefinition

"an algorithm is any well-defined computational procedure that takes some value, or set of values, as input and produces some value, or set of values as output.“

Introduction to Algorithms (Second Edition)

by Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, Clifford Stein

Page 3: What is an algorithm?

Road MapsRoad Maps

algorithms are like road maps for accomplishing a given, well-defined task.

Page 4: What is an algorithm?

Instruction listInstruction list

Generally, an algorithm is a systematic list of instructions for accomplishing some task, and the task can be anything that has a recognizable end-point (or result).

Often some of the specific steps in the procedure are to be repeated until the task is done.

Normally, there are different algorithms for the same task, some better than others.

Page 5: What is an algorithm?

Computer programComputer program

a computer program is essentially an algorithm that tells the computer: what specific steps to perform, in what specific order, to carry out a specific task

Page 6: What is an algorithm?

ComputationalComputational

For any such computational process, the algorithm must be completely laid down: the way it applies in all possible circumstances that could arise must be specified.

That is, any conditional steps must be systematically dealt with, case-by-case; the criteria for each case must be clear (and computable)

Page 7: What is an algorithm?

Precise orderPrecise order

Because an algorithm is a precise list of precise steps, the order of operations will almost always be important.

Instructions are usually assumed to be listed explicitly, and are described as starting 'from the top' and going 'down to the bottom', an idea that can be discussed more formally in terms of flow of control.

Page 8: What is an algorithm?

Defined procedureDefined procedure

Once a formal description has been obtained, an algorithm is a well-defined method or procedure:

for solving a problem, such as a problem in mathematics;

or otherwise relating to the manipulation of information.

Page 9: What is an algorithm?

ImplementationImplementation

Algorithms are implemented

as computer programs, as electric circuits, mechanically,or by humans.