ET210x: Data Structures & Algorithms
Đào Trung Kiên @ MICA Institute & Dept. of Comm. Eng., SEEE, Hanoi Univ. of Science and Technology
1
Week 3: Algorithm Flowchart
& Pseudo-code
Algorithm Flowchart
Pseudo-code
ET210x: Data Structures & Algorithms
Đào Trung Kiên @ MICA Institute & Dept. of Comm. Eng., SEEE, Hanoi Univ. of Science and Technology
2
Algorithm Flowchart
ET210x: Data Structures & Algorithms
Đào Trung Kiên @ MICA Institute & Dept. of Comm. Eng., SEEE, Hanoi Univ. of Science and Technology
Flowchart
A graphical representation of the sequence of
operations in an algorithm
Shows the sequence of instructions in a program
Helps visualize and understand how a program
works
3
ET210x: Data Structures & Algorithms
Đào Trung Kiên @ MICA Institute & Dept. of Comm. Eng., SEEE, Hanoi Univ. of Science and Technology
Element
Description
Process input/output
Displayed output
Flow continues at a
target on the same
chart (to avoid long
arrows)
Flow continues at a
target on another
page
Element
Description
Beginning or end of a
process
A step (task, action)
in a process
Directional execution
flow
Conditional decision,
this
-or-that choice
branch
Basic Elements (*)
4
Arrow
Display
Data
Process
Off-page
connector
Decision
On-page
connector
Terminator
(*) ANSI/ISO compliant
ET210x: Data Structures & Algorithms
Đào Trung Kiên @ MICA Institute & Dept. of Comm. Eng., SEEE, Hanoi Univ. of Science and Technology
Example 1
Write an algorithm
and draw a
flowchart that will
read the two sides
of a rectangle and
calculate its area.
5
Start
Input W, L
A W ×L
Print A
Stop