ALGORITHM
Look around you. Computers and networks are everywhere, enabling an intricate web of complex
human activities: education, commerce, entertainment, research, manufacturing, health management,
communication, even war. In mathematics, computer science, and related subjects, an algorithm is a
finite sequence of steps expressed for solving a problem. An algorithm can be defined as “a process that
performs some sequence of operations in order to solve a given problem”. Algorithms are used for
calculation, data processing, and many other fields.
Three reasons for using algorithms are efficiency, abstraction and reusability.
Efficiency: Certain types of problems, like sorting, occur often in computing. Efficient algorithms
must be used to solve such problems considering the time and cost factor involved in each
algorithm.
Abstraction: Algorithms provide a level of abstraction in solving problems because many
seemingly complicated problems can be distilled into simpler ones for which well-known
algorithms exist. Once we see a more complicated problem in a simpler light, we can think of
the simpler problem as just an abstraction of the more complicated one.
Reusability: Algorithms are often reusable in many different situations. Since many well-known
algorithms are the generalizations of more complicated ones, and since many complicated
problems can be distilled into simpler ones.
FLOWCHARTS
Before you start coding a program it is necessary to plan the step by step solution to the task your
program will carry out. Such a plan can be symbolically developed using a diagram. This diagram is called
a flowchart. Hence a flowchart is a symbolic representation of a solution to a given task. A flowchart can
be developed for practically any job. Flowcharting is a tool that can help us to develop and represent
graphically program logic sequence. It also enables us to trace and detect any logical or other errors
before the programs are written.
A flowchart describes what operations (and in what sequence) are required to solve a given problem. A
flowchart can be likened to the blueprint of a building block of program. As we know a designer draws a
blueprint before starting construction on a building. Similarly, a programmer prefers to draw a flowchart
prior to writing a computer program. Flowcharts are a pictorial or graphical representation of a process.
The purpose of all flow charts is to communicate how a process works or should work without any
technical or group specific jargon.
Flowcharts are used in analyzing, designing, documenting or managing a process or program in various
fields.
Flowcharts are generally drawn in the early stages of formulating computer solutions. Flowcharts often
facilitate communication between programmers and business people. These flowcharts play a vital role
in the programming of a problem and are quite helpful in understanding the logic of complicated and
lengthy problems. Once the flowchart is drawn, it becomes easy to write the program in any high level
language. Often we see how flowcharts are helpful in explaining the program to others. Hence, it is
correct to say that a flowchart is a must for the better programming / documentation of a complex
program.
Advantages of Using Flowcharts:
The benefits of flowcharts are as follows:
Communication: Flowcharts are better way of communicating the logic of a system to all
concerned.
Effective analysis: With the help of flowchart, problem can be analysed in more effective way.
Proper documentation: Program flowcharts serve as a good program documentation, which is
needed for various purposes.
Efficient Coding: The flowcharts act as a guide or blueprint during the systems analysis and
program development phase.
Proper Debugging: The flowchart helps in debugging process.
Efficient Program Maintenance: The maintenance of operating program becomes easy with the
help of flowchart. It helps the programmer to put efforts more efficiently on that part.
Limitations of Using Flowcharts:
Although a flowchart is a very useful tool, there are a few limitations in using flowcharts which are
listed below:
Complex logic: Sometimes, the program logic is quite complicated. In that case, flowchart
becomes complex and clumsy.
Alterations and Modifications: If alterations are required the flowchart may require re-drawing
completely.
Reproduction: As the flowchart symbols cannot be typed, reproduction of flowchart becomes a
problem.
The essentials of what is done can easily be lost in the technical details of how it is done.
When to Use a Flowchart:
Flow charts can used to communicate to others how a process is done.
A flowchart is generally used when a new project begins in order to plan for the project.
A flowchart helps to clarify how things are currently working and how they could be improved. It
also assists in finding the key elements of a process, while drawing clear lines between where
one process ends and the next one starts.
Developing a flowchart stimulates communication among participants and establishes a
common understanding about the process. Flowcharts also uncover steps that are redundant or
misplaced.
Flowcharts are used to help team members, to identify who provides inputs or resources to
whom, to establish important areas for monitoring or data collection, to identify areas for
improvement or increased efficiency, and to generate hypotheses about causes.
It is recommended that flowcharts be created through group discussion, as individuals rarely
know the entire process and the communication contributes to improvement.
Flowcharts are very useful for documenting a process (simple or complex) as it eases the
understanding of the process.
Flowcharts are also very useful to communicate to others how a process is performed and
enables understanding of the logic of a process.
Flowchart Symbols & Guidelines:
Flowcharts are usually drawn using some standard symbols; however, some special symbols can also be
developed when required. Some standard symbols, which are frequently required for flowcharting many
computer programs are shown in below table.
Name of Symbol Description Symbol
symbol
Terminator An oval shape in flow chart indicates the start or end
Or of the process, usually containing the word “Start” or Start End
Oval “End”.
Process: A rectangle shape in flow chart indicates a
normal/generic process flow step. For example, “Add A=B+C
1 to X”, “M = M*F”, X=10 etc. C = 10
Decision A diamond flow chart shape indicates a branch in the
Box process flow. This symbol is used when a decision
needs to be made, commonly a Yes/No question or If
X == 10
True/False test.
x--
Input Box / A parallelogram that indicates data input or output
Output Box (I/O) for a process. Examples: Get X from the user, Input
Display X. Limit
Arrow Arrows are used to show the flow of control in a
Flow lines process. An arrow coming from one symbol and
ending at another symbol represents that control
passes to the symbol the arrow points to.
Connector A small, labelled, circular flow chart shape used to
indicate a jump in the process flow. Connectors are X
generally used in complex or multi-sheet diagrams. X
These are the basic symbols used generally. Now, the basic guidelines for drawing a flowchart with the
above symbols are that:
In drawing a proper flowchart, all necessary requirements should be listed out in logical order.
The flowchart should be neat, clear and easy to follow. There should not be any room for
ambiguity in understanding the flowchart.
The flowchart is to be read left to right or top to bottom.
A process symbol can have only one flow line coming out of it.
For a decision symbol, only one flow line can enter it, but only two lines can leave it to denote
possible answers (yes/no).
The terminal symbols can only have one flow line in conjunction with them.