ALGORITHM DESIGN &
REPRESENTATION
(FLOWCHART)
OBJECTIVES:
At the end of the lesson, the students should be able to:
• Understand what algorithm truly is, its definition and characteristics.
• Know about flowchart and its symbols and apply it in problem solving.
ALGORITHM – DEFINITION
“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. An
algorithm is thus a sequence of computational steps that transform the
input into the output.” (Thomas H. Cormen et al.)
ALGORITHM & IT’S CHARACTERISTICS
INPUT - Accepts zero or more user resources externally.
OUTPUT - Must produce at least one result of the procedure.
DEFINITENESS - Each instruction must be clear & unambiguous.
FINITENESS - All cases must terminate after conditions are met or after a
finite number of steps.
EFFECTIVENESS - Every instruction must be very basic so that it can be
carried out and must be feasible to perform on any machine.
FLOWCHART
A flowchart is a type of diagram that represents an algorithm or process.
Showing the steps as shapes of various kinds and their order by
connecting them with arrows.
BASIC FLOWCHART SYMBOLS
Oval Arrows Parallelogram Rectangle Diamond
Represents a Direction of Used as either Denotes a Indicates that a
start or end logic flow in a input or output process to be decision is to
point program operation carried out be made.
ALGORITHM PRESENTED AS A FLOWCHART
START
• Flow of algorithm can be IS YES
represented using a flowchart. RESULT
<5?
“GOOD”
NO
ENTER A NUMBER
• Easier to understand because of AS INT1
GET INT1
its graphical nature. “VERY
GOOD” END
ENTER A NUMBER
AS INT2
GET INT2
RESULT AS INT1 + INT2