Algorthms
Algorthms
Objectives
– What is an Algorithm.
– An algorithm lists the steps involved in accomplishing a task that should come
after the problem has been thoroughly analyzed and solution outlined.
– It can be defined in programming terms as :
a. a set of detailed,
b. unambiguous and
c. ordered instructions,
developed to describe the processes necessary to produce the desired output from a
given input.
– an algorithm is a step-by-step procedure to solve a given problem
What is an Algorithm?
– An algorithm must:
– be lucid, precise, and unambiguous
– give the correct solution in all cases
– eventually end(Have finite steps)
– Finiteness
– It has to finish at some point
– An algorithm must terminate in a finite number of steps
– Absence of ambiguity
– Only one interpretation
– Sequence
– Need to know the order of execution
– Input/output
– 0 or more inputs and at least 1 output
– Effectiveness
– Must be capable of performing each step
– Each step must be effective, in the sense that it should be primitive (easily convertible
into program statement) can be performed exactly in a finite amount of time.
Algorithms are independent of
any language
Problem
Algorithm
Algorithm
Representation
− There are many ways in which we may represent an
algorithm;
− We use many techniques to represent an algorithm
in computer programming. The techniques that will
study are:
− Flowchart – Using symbols
− Pseudocode – Using English like code
Conclusion
– Algorithms give the outlined solution step by step in the for of pseudocode or a
flowchart
– It is written for different programmers and other business people so it must be
as clear as possible.
The End