Algorithm and Flow Chart
1. What is Algorithm?
Ans:-A process or set of rules to be followed in calculations or other
problem-solving operations, is called Algorithm.
Characteristics of Algorithm:-
Algorithm must have the following characteristics:
i) 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.
ii) Well-Defined Inputs: If an algorithm says to take inputs, it should be
well-defined inputs.
iii) Well-Defined Outputs: The algorithm must clearly define what output
will be yielded and it should be well-defined as well.
iv) Finiteness: The algorithm must be finite, i.e. it should not end up in an
infinite loops or similar.
v) 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.
vi) 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.
Advantages of Algorithms:-
i) It is easy to understand.
ii) Algorithm is a step-wise representation of a solution to a given
problem.
iii) In Algorithm the problem is broken down into smaller pieces or steps
hence, it is easier for the programmer to convert it into an actual
program.
Disadvantages of Algorithms:-
i) Writing an algorithm takes a long time so it is time-consuming.
ii) Branching and Looping statements are difficult to show in Algorithms.
2. What is Flowchart?
Ans:-Flowchart is a graphical representation of an algorithm. It makes
use of symbols which are connected among them to indicate the flow of
information and processing.
Basic Symbols used in Flowchart Designs:-
Symbols Name Description
The oval symbol
indicates Start, Stop
and Halt in a
program’s logic flow. A
pause/halt is generally
used in a program logic
Terminal Box under some error
conditions. Terminal is
the first and last
symbols in the
flowchart. It accepts
one input line and gives
one output line.
A parallelogram
denotes any function of
input/output type.
Program instructions
that take input from
input devices and
Input/Output Box display output on
output devices are
indicated with
parallelogram in a
flowchart. It accepts
one input line and gives
one output line.
Symbols Name Description
A rectangular box
represents arithmetic
instructions. All
arithmetic processes
such as adding,
subtracting,
Processing Box
multiplication and
division are indicated
by action or process
symbol. It accepts one
input line and gives one
output line.
Diamond symbol
represents a decision
point. Decision based
operations such as
yes/no question or
Decision Box
true/false are indicated
by diamond in
flowchart. It accepts
one input line but gives
two output lines.
Whenever flowchart
becomes complex or it
spreads over more
than one page, it is
Connector useful to use
connectors to avoid
any confusions. It is
represented by a
circle.
Flow lines indicate the
exact sequence in
which instructions are
executed. Arrows
Flow Lines represent the direction
of flow of control and
relationship among
different symbols of
flowchart.
Symbols Name Description
Predefined Process
Predefined Process indicates any user
defined programs
Advantages of Flowchart:-
i) Flowcharts are better way of communicating the logic of system.
ii) Flowcharts help in debugging process.
iii) With the help of flowcharts programs can be easily analysed.
iv) It provides better documentation.
Disadvantages of Flowchart:-
i) It is difficult to draw flowchart for large and complex programs.
ii) In this there is no standard to determine the amount of detail.
iii) It is very difficult to modify the Flowchart.