Representation of Algorithm and Flow Chart
Representation of Algorithm and Flow Chart
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.
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
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, etc.
Definition of Flowchart
• Input / Output
• Process / Instruction
• Decision
• Connector / Arrow
The graphics above represent different part of a flowchart. The process in a flowchart
can be expressed through boxes and arrows with different sizes and colors. In a
flowchart, we can easily highlight a certain element and the relationships between each
part.
If you compare a flowchart to a movie, then an algorithm is the story of that movie. In
other words, an algorithm is the core of a flowchart. Actually, in the field of computer
programming, there are many differences between algorithm and flowchart regarding
various aspects, such as the accuracy, the way they display, and the way people feel
about them. Below is a table illustrating the differences between them in detail.
Algorithm Flowchart
It is a procedure for solving problems. It is a graphic representation of a process.
The process is shown in step-by-step The process is shown in block-by-block information
instruction. diagram.
It is complex and difficult to understand. It is intuitive and easy to understand.
It is convenient to debug errors. It is hard to debug errors.
The solution is showcased in natural
The solution is showcased in pictorial format.
language.
It is somewhat easier to solve complex
It is hard to solve complex problem.
problem.
It costs more time to create an algorithm. It costs less time to create a flowchart.
What is an Algorithm?
3. Algorithms should be most effective among many different ways to solve a problem.
4. An algorithm shouldn't have computer code. Instead, the algorithm should be written in
such a way that, it can be used in different programming languages.
The Algorithm designed are language-independent, i.e. they are just plain instructions
that can be implemented in any language, and yet the output will be the same, as
expected.
What are the Characteristics of an Algorithm?
As one would not follow any written instructions to cook the recipe, but only the
standard one. Similarly, not all written instructions for programming is an algorithm. In
order for some instructions to be an algorithm, it must have the following characteristics:
• Clear and Unambiguous: Algorithm should be clear and unambiguous. Each of
its steps should be clear in all aspects and must lead to only one meaning.
• Well-Defined Inputs: If an algorithm says to take inputs, it should be well-defined
inputs.
• Well-Defined Outputs: The algorithm must clearly define what output will be
yielded and it should be well-defined as well.
• Finite-ness: The algorithm must be finite, i.e. it should not end up in an infinite
loops or similar.
• Feasible: The algorithm must be simple, generic and practical, such that it can be
executed upon will the available resources. It must not contain some future
technology, or anything.
• Language Independent: The Algorithm designed must be language-independent,
i.e. it must be just plain instructions that can be implemented in any language, and
yet the output will be same, as expected.
EXAMPLE –
TO ADD TWO NUMBERS
1. START
2. ENTER TWO NUMBERS
3. ADD NUMBERS(C= A+B)
4. PRINT RESULT
5. STOP