Formulating Algorithms 朅ssigned reading |
Read sections 4.8, 4.9, 4.10 pp 124-140 Chapter 4 of Deitel & Deite |
Algorithms
An Algorithm is a set of steps that defines how a task is performed. It is
important to make a distinction between an algorithm and its
representation. The distinction is analogous to that between a story and a
book. A story is abstract or conceptual; a book is a physical
representation of a story. The representation of the story can change -
the book can be translated into different languages, or made into a film,
theatre play - the story itself remains the same.
An
algorithm is abstract and distinct from its representation and can be
represented in many ways.
For
example the algorithm for converting the temperature in degrees Celsius to
Farenheit can be expressed as an algebraic formula:
F
= (((9*C)/5)+ 32)
Or
Multiply
the temperature in Celsius by 9, divide the product by 5 and then add 32.
Algorithms
are represented as programs within computers. The algorithm for converting
Celsius to Farenheit is used in the Temperature
conversion example in Unit 8 implemented as a method called
convert.
Back
to top

RITSEC - Global Campus
Copyright ?1999 RITSEC- Middlesex University. All rights reserved.
webmaster@globalcampus.com.eg
|