Click here to load reader
View
446
Download
0
Embed Size (px)
DESCRIPTION
Basic definition of algorithm
Citation preview
What is an algorithm?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
Road MapsRoad Maps
algorithms are like road maps for accomplishing a given, well-defined task.
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.
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
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)
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.
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.
ImplementationImplementation
Algorithms are implemented
as computer programs, as electric circuits, mechanically,or by humans.