You are on page 1of 4

ALGORITHM

1. Algorithm is a step-by-step procedure, which defines a set of instructions to


be executed in a certain order to get the desired output. An algorithm can be
implemented in more than one programming language. Algorithms have a
definite beginning and a definite end, and a finite number of steps. When
implement an algorithm using any programming language, then it is said to
be program.

2. An algorithm is a well defined computational procedure that takes some value


or set of values as input and gives or produces some value or set of values as
output. That is an algorithm is a sequence of computational steps that
transform the input in to output.

Characteristics of a good algorithm

1. Finiteness: An algorithm must terminate after a finite number of steps and


further each step must be executable in finite amount of time
2. Definiteness (no ambiguity): Each steps of an algorithm must be precisely
defined.
3. Inputs: An algorithm has zero or more but only finite number of inputs.
4. Output: An algorithm has one or more outputs. The outputs have specific
relation to the inputs, where the relation is defined by the algorithm.
5. Effectiveness: An algorithm should be effective. This means that each of the
operation to be performed in an algorithm must be done exactly in a finite
length of time. If a sequence of steps is not finite, then it cannot be effective
also.

Algorithm Complexity

Suppose X is an algorithm and n is the size of input data, the time and space used
by the algorithm X are the two main factors, which decide the efficiency of X.

 Time Factor − Time is measured by counting the number of key operations


such as comparisons in the sorting algorithm.
 Space Factor − Space is measured by counting the maximum memory space
required by the algorithm.

For each problem or class of problems, there may be many different algorithms and
for each algorithm, there may be many different implementations (programs).

Write an algorithm to find average of two numbers.


Step 1: Input two numbers. (Suppose a=6, b=6)
Step 2: Do the total of two numbers (i.e a+b=12)
Step 3: Find the average by dividing the total by 2 (i.e 12/2=6)
Step 4: Display the answer. (6)
Step 5: End

An algorithm may be expressed in a number of ways, including:


natural language: usually ambiguous
flow charts: issues of ambiguity; difficult to modify without specialized tools.
pseudo-code: also avoids most issues of ambiguity; vaguely resembles
common elements of programming languages; no
particular agreement on syntax
programming language
: tend to require expressing low-level details that are not
necessary for a high-level understanding

A flowchart is a type of diagram that represents a workflow or process Also called:


process flowchart, process flow diagram
Flowchart
What is a flowchart?
A flowchart is a picture (graphical representation) of the problem
solving process.
A flowchart gives a step-by-step procedure for solution of a
problem.
Elements of a flowchart:
Various geometrical shaped boxes represent the steps of the
solution.
The boxes are connected by directional arrows to show the
flow of the solution.
Uses of a flowchart:
To specify the method of solving a problem.
To plan the sequence of a computer program.
Communicate ideas, solutions.

Drawing a flowchart
Identify input and output.
Apply reasoning skills to solve the problem.
Draw the flowchart using the appropriate symbols and arrows to show the
sequence of steps in solving the problem.

Basic Symbols used in Flowchart Designs

1. Terminal: The oval symbol indicates Start, Stop and Halt in a program’s logic
flow. A pause/halt is generally used in a program logic under some error
conditions. Terminal is the first and last symbols in the flowchart.

2. Input/Output: A parallelogram denotes any function of input/output type.


Program instructions that take input from input devices and display output on
output devices are indicated with parallelogram in a flowchart.

3. Processing: A box represents arithmetic instructions. All arithmetic


processes such as adding, subtracting, multiplication and division are
indicated by action or process symbol.

4. Decision Diamond symbol represents a decision point. Decision based


operations such as yes/no question or true/false are indicated by diamond in
flowchart.

5. Connectors: Whenever flowchart becomes complex or it spreads over more


than one page, it is useful to use connectors to avoid any confusions. It is
represented by a circle.

6. Flow lines: Flow lines indicate the exact sequence in which instructions are
executed. Arrows represent the direction of flow of control and relationship
among different symbols of flowchart.

Types
Sterneckert (2003) suggested that flowcharts can be modeled from the perspective
of different user groups (such as managers, system analysts and clerks), and that
there are four general types:[10]

 Document flowcharts, showing controls over a document-flow through a


system
 Data flowcharts, showing controls over a data-flow in a system
 System flowcharts, showing controls at a physical or resource level
 Program flowchart, showing the controls in a program within a system

Uses of Flowcharts

Flowcharts were originally used by industrial engineers to structure work processes


such as assembly line manufacturing.

Today, flowcharts are used for a variety of purposes in manufacturing, architecture,


engineering, business, technology, education, science, medicine, government,
administration and many other disciplines.

Here are some of the ways flowcharts are used today.

 Project planning
 Program or system design through flowchart programming
 Process documentation
 Audit a process for inefficiencies or malfunctions
 Map computer algorithms
 Documenting workflow

You might also like