You are on page 1of 8

ALGORITHM

What is Algorithm?

An algorithm is a list of instructions for carrying out some process step by step. A recipe
in a cookbook is an excellent example of an algorithm. The number of its basic steps and
position is very small, but putting them together in different ways, an endless variety of delicious
food can be cooked.

Example:

If we can devise an algorithm for a process, we can usually do so in many different ways.
Here is one algorithm for the usual process of changing a flat tire.

1. Jack up the car


2. Unscrew the Lugs
3. Remove the wheel.
4. Put on the spare.
5. Screw the lugs.
6. Jack down the car.
FLOWCHART

What is flowchart?
A flowchart is a diagram representing the logical sequence in which a combination of
steps or operation is to be performed. It consists of labeled geometrical symbols that are
interconnected to provide a pictorial representation of a data processing procedure.
A flowchart is actually a visual representation of an algorithm. To the programmer, a
flowchart is a kind of an all-purpose tool. It is the “blueprint” of a program.

What is the purpose of flowchart?


A logic or process flowchart is a graphical representation of the flow of logic, control,
data, or paperwork through a program, a routine, a module, or a process. The flowchart specifies
or documents the order in which tasks are performed. Flowcharts are used for documentation and
for planning.

Advantages and Limitations of Flowchart

Advantages:
There are advantages and limitations in the use of flowcharts.

1. Since flowcharts are language-independent, they can be learned and applied without
formal knowledge of a programming language.
2. It enforces users to give attention to significant matters over the less significant ones.
3. Being graphically portrayed, flowcharts provided an alternative to the usual description of
a system r a program.
4. Flowcharts are easier to understand than a program written in a particular programming
language.

Limitations:

1. Flowcharts do not represent a programming language and are not more of a person-to-
person than a person-to-computer means of communication. A computer cannot accept
program described in flowcharting form.
2. Since thinking in graphic terms is not normal, flowcharts cannot be viewed as a natural
means of communication.
3. Certain details often require a long sequence of interconnected symbols which could
easily be described in just a few lines of explanation.
4. It does not convey why a given set of operation is made. Flowcharts only portray how.
5. Flowchart does not highlight the important details since each step receives as much
attention in a flowchart as any other.
Inputs and Related Ideas

Before creating a logic or process flowchart, the designer must understand the algorithm
or procedure. The necessary information might be compiled from direct observation, extracted
from existing documentation, or derived from the information gathered during the problem
definition and/or systems analysis stages of the system development life cycle.

Other tools for documenting or planning routines or processes include Nassi-Shneiderman charts,
decision trees, decision tables , pseudocode, structured English, and input/process/output (IPO)
charts. A routine often exists in the context of a larger program. Tools for documenting or
planning program structure include structure charts and HIPO.

Logic flowcharts are sometimes confused with system flowcharts. A system flowchart
documents the physical relationships between a system’s physical components. A logic flowchart
shows the flow of logic, control, or data through a routine or a procedure.

TYPES FLOWCHART

The two major types of flowcharts are the program and system flowcharts.

Program Flowcharts
A program flowchart describes graphically in detail the logical operations and steps
within a program and the sequence in which these steps are to be executed for the transformation
of data to produce the needed output.

System Flowchart
A system flowchart is a graphic representation of the procedures involved in converting
data on input media to data in output form. It illustrate which data is used or produced at various
points in a sequence of operation
FLOWCHART SYMBOLS

The basic symbols of a program flowchart are given below.

Terminal or This shape tells you where the flowchart begins and ends. It shows the entry
Terminator point of your flowchart and the exit point. To designate the start of your
Symbol flowchart, you would fill this shape with words like Start or Begin. The
words you use are up to you.

To designate the ending point of the chart, this shape is filled with words
like End, Exit, or Return.

Flow Lines You read a flowchart by following the lines with arrows from shape to
shape. The lines with arrows determine the flow through the chart.
Flowcharts are usually drawn from top to bottom or left to right. Numbering
shapes is optional. Numbering is helpful if you have to refer to a shape in a
discussion.

If two lines cross, you ignore the perpendicular line and continue following
the line to the next shape. If there may be confusion as to the path, you can
insert a bridge or crossover, which is a little bump on crossed lines.
Processing In most flowcharts, the rectangle is the most common shape. It is used to
show a process, task, action, or operation. It shows something that has to be
done or an action that has to be taken. The text in the rectangle almost
always includes a verb.

Symbol

Decision Symbol A decision asks a question. The answer to the question determines which
arrow you follow out of the decision shape. For example, in the shape
below, if it is cloudy, you follow the arrow down near the word Yes. If it is
not cloudy, you follow the arrow to the right near the word No.
The arrows flowing from the decision shape are usually labeled
with Yes, No or True, False. But you can label them any way you want as
long as the meaning is clear. This shape has one input arrow. It is usually at
the top, but can be on any corner. The decision shape can have two or three
exit points. If you need more than 3 exit points, then you can use either of
the methods shown below.
Circle If you need to connect to another page or another section of the chart, and
can't draw a line, you can use a circle. You draw the line to the circle and
label the circle with a letter. Then you place a copy of the circle where you
want the flow to continue. This should be avoided, but sometimes is
necessary. Originally the circle was used only to reference another part of
the chart and the off page connector, shown later, was used to go to another
page. However, the circle is now often used for both.

Input/Output
A parallelogram is used to show input or output. Examples of input are
receiving a report, getting an e-mail, getting an order, receiving data in
some format, etc. Examples of output are generating a report, sending an e-
mail, faxing a message, etc.

Off Page This shape means the flow continues on another page. A letter or page
Connector number in the shape tells you where to go. It is an alternative to using a
circle.

This shape was originally used by IBM programmers to set a switch, modify
Preparation an index register, or initialize a routine. Currently you can use it to
differentiate between steps that prepare for work versus steps that actual do
the work. It is probably best not to use this shape at all.
X= 0
Pi=3.1416

For most flowcharting you need only use the basic flowchart shapes
listed above. Those listed below are included to be complete, but you
don't have to use them.

The Delay shape represents a waiting period where no activity is done. In


Process Mapping, delays are often important as they may result in adding to
Delay the cost of the product or simply delaying its production. Delays should be
analyzed to see if they can be minimized or eliminated.

You might also like