Algorithm and
flowchart
Lect.
Faiza Mahmood
Algorithm and flowchart
O Algorithm and flowchart are two types of tools to
explain the process of a program. This page
extends the differences between an algorithm and a
flowchart, and how to create a flowchart to explain
an algorithm in a visual way.
O Algorithms and flowcharts are two different tools
used for creating new programs, especially in
computer programming. An algorithm is a step-by-
step analysis of the process, while a flowchart
explains the steps of a program in a graphical way.
Definition of Algorithm
O To write a logical step-by-step method to solve
the problem is called algorithm, in other
words, an algorithm is a procedure for solving
problems. In order to solve a mathematical or
computer problem, this is the first step of the
procedure. An algorithm includes calculations,
reasoning and data processing. Algorithms can
be presented by natural languages, pseudo
code and flowcharts,
Advantages and
Disadvantages of Algorithms
O Advantages
O 1- One of these advantages is in the development of the
procedure itself, which involves the identification of the
processes, major decision points, and variables necessary to
solve the problem.
O 2- Developing an algorithm allows and even forces
examination of the solution process in a rational manner.
O 3- Identification of the processes and decision points
reduces the task into a series of smaller steps of more
manageable size
O 4- The required specification aids in the identification and
reduction of subconscious biases. By using an algorithm,
decision-making becomes a more rational process.
O 5- Solution process allows the identification of weaknesses
and errors in the process.
Disadvantages
O 1- One disadvantage of algorithms is that
they always terminate, which means there
are some computational procedures—
occasionally even useful ones—which are
not algorithms
O 2- All computational procedures, whether
they terminate or not, can only give
computable results.
Definition of Flowchart
O A flowchart is the graphical or pictorial
representation of an algorithm with the help
of different symbols, shapes and arrows in
order to demonstrate a process or a
program. With algorithms, we can easily
understand a program. The main purpose of
a flowchart is to analyze different processes.
Several standard graphics are applied in a
flowchart:
Advantages and Disadvantages
of Flow Chart
O Advantages
O 1. Communication: Flow Charts are better way of
communicating the logic of a system to all concerned.
O 2. Effective Analysis: With the help of flow chart, problem can be
analyzed in more effective way.
O 3. Proper Documentation: Program flow charts serve as a good
program documentation, which is needed for various purposes.
O 4. Efficient Coding: The flow charts act as a guide or blueprint
during the systems analysis and program development phase.
O 5. Proper Debugging: The flow chart helps in debugging process.
O 6. Efficient Program Maintenance: The maintenance of
operating program becomes easy with the help of flow chart. It
helps the programmer to put efforts more efficiently on that part.
Disadvantages
O Complex logic: Sometimes, the program logic is
quite complicated. In that case, flow chart
becomes complex and clumsy.
O 1. Alterations and Modifications: If alterations
are required the flow chart may require
redrawing completely.
O 2. Reproduction: As the flow chart symbols
cannot be typed, reproduction of flow chart
becomes a problem.
O 3. The essentials of what is done can easily be
lost in the technical details of how it is done.
Common symbols
The American National Standards Institute (ANSI) set standards for
flowcharts and their symbols in the 1960s. The International Organization
for Standardization (ISO) adopted the ANSI symbols in 1970. The
current standard was revised in 1985. Generally, flowcharts flow from top
to bottom and left to right
Example1: Convert Temperature from Fahrenheit (℉) to
Celsius (℃)
Flowchart:
A, B, C are the marks scored by a student in Science, Mathematics and English.
Refer the flowchart