Algorithm & Flowchart1
Algorithm & Flowchart1
OBJECTIVES
INTRODUCTION
INTRODUCTION
INTRODUCTION
What is Algorithm?
What is Algorithm?
PROPERTIES OF ALGORITHM
Donald Ervin Knuth has given a list of five
properties for an algorithm, these
properties are:
1) FINITENESS
2) DEFINITENESS
3) INPUT
4) OUTPUT
5) EFFECTIVENESS
12/21/2023
PROPERTIES OF ALGORITHM
1) FINITENESS:
An algorithm must always terminate
after a finite number of steps. It
means after every step one reach
closer to solution of the problem and
after a finite number of steps
algorithm reaches to an end point.
12/21/2023
PROPERTIES OF ALGORITHM
2) DEFINITENESS
Each step of an algorithm must be
precisely defined. It is done by well
thought actions to be performed at
each step of the algorithm. Also the
actions are defined unambiguously for
each activity in the algorithm.
12/21/2023
PROPERTIES OF ALGORITHM
3) INPUT
Any operation you perform need
some beginning value/quantities
associated with different activities in
the operation. So the value/quantities
are given to the algorithm before it
begins.
12/21/2023
PROPERTIES OF ALGORITHM
4) OUTPUT:
One always expects output/result
(expected value/quantities) in terms of output
from an algorithm. The result may be obtained
at different stages of the algorithm. If some
result is from the intermediate stage of the
operation then it is known as intermediate
result and result obtained at the end of
algorithm is known as end result. The output
is expected value/quantities always have a
specified relation to the inputs.
12/21/2023
PROPERTIES OF ALGORITHM
5) EFFECTIVENESS:
Algorithms to be developed/written
using basic operations. Actually operations
should be basic, so that even they can in
principle be done exactly and in a finite
amount of time by a person, by using paper
and pencil only.
12/21/2023
PROPERTIES OF ALGORITHM
ALGORITHM EXAMPLES
Let us take one simple day-to-day example
by writing algorithm for making, “Maggi
Noodles‟ as a food.
Step 1: Start
Step 2: Take pan with water
Step 3: Put pan on the burner
Step 4: Switch on the gas/burner
Step 5: Put magi and masala
Step 6: Give two minutes to boil
Step 7: Take off the pan
Step 8: Take out the magi with the help of
fork/spoon
Step 9: Put the maggi on the plate and serve it
Step 10: Stop.
12/21/2023
ALGORITHM EXAMPLES
Step 1: Start
Step 2: Print “Good Morning‟
Step 3: Stop
12/21/2023
ALGORITHM EXAMPLES
Step 1: Start
Step 2: Take length and breadth and
store them as L and B?
Step 3: Multiply by L and B and store it
in area
Step 4: Print area
Step 5: Stop
12/21/2023
ALGORITHM EXAMPLES
ALGORITHM EXAMPLES
Step 1: Start
Step 2: Take any number and store it in n.
Step 3: Check n value, if n > 0 then go to
step 5 else go to step 4
Step 4: Check n value, if n < 0 then go to
step 6 else go to step 7
12/21/2023
ALGORITHM EXAMPLES
FLOWCHART
12/21/2023
FLOWCHART
The flowchart is a diagram which visually pre
sents the flow of data through processing
systems. This means by seeing a flow chart o
ne can know the operations performed and
the sequence of these operations in a syste
m. Algorithms are nothing but sequence of
steps for solving problems. So a flow chart ca
n be used for representing an algorithm. A
flowchart, will describe the operations
(and in what sequence) are required
to solve a given problem.
12/21/2023
FLOWCHART
BUILDING BLOCKS
OF
FLOW CHART
OR
COMMON SYMBOLS
OF
FLOW CHART
12/21/2023
ANSI/ISO
Name Description
Shape
Shows the process's order of
operation. A line coming from
one symbol and pointing at
Flowline
another. Arrowheads are
(Arrowhead)
added if the flow is not the
standard top-to-bottom, left-
to right.
12/21/2023
ANSI/ISO
Name Description
Shape
Indicates the beginning and ending
of a program or sub-process.
Represented as a stadium, oval or
rounded (fillet) rectangle. They
Terminal usually contain the word "Start" or
"End", or another phrase signaling
the start or end of a process, such as
"submit inquiry" or "receive
product".
12/21/2023
ANSI/ISO
Name Description
Shape
Represents a set of operations that
Process changes value, form, or location of
data. Represented as a rectangle
12/21/2023
ANSI/ISO
Name Description
Shape
Shows a conditional operation that
determines which one of the two
paths the program will take. The
Decision operation is commonly a yes/no
question or true/false test.
Represented as a diamond
(rhombus).
12/21/2023
ANSI/ISO
Name Description
Shape
Indicates the process of inputting
Input / and outputting data, as in entering
data or displaying results.
Output
Represented as a parallelogram
12/21/2023
ANSI/ISO
Name Description
Shape
Indicating additional
information about a step the
Annotation program. Represented as an
open rectangle with a dashed
(Comment) or solid line connecting it to
ANSI/ISO
Name Description
Shape
Shows named process
Predefined /Function which is defined
Process
elsewhere. Represented as
Functions a rectangle with double-
struck vertical edges.
12/21/2023
ANSI/ISO
Name Description
Shape
Pairs of labelled connectors
replace long or confusing
On-page
lines on a flowchart page.
Connector
Represented by a small
circle with a letter inside.
12/21/2023
ANSI/ISO
Name Description
Shape
A labelled connector for
use when the target is on
Off-page
another page. Represented
Connector
as a home plate-
shaped pentagon.
12/21/2023
ANSI/ISO
Name Description
Shape
ANSI/ISO
Name Description
Shape
1. COMMUNICATION.
2. EFFECTIVE ANALYSIS.
3. DOCUMENTATION OF PROGRAM/SYSTEM.
4. EFFICIENT PROGRAM MAINTENANCE.
5. CODING OF THE PROGRAM.
12/21/2023
FLOWCHART EXAMPLES
Draw a flowchart to find the simple interest.
(Sequence)
12/21/2023
FLOWCHART EXAMPLES
Draw a flowchart to find bigger number
among two numbers (selective)
12/21/2023
FLOWCHART EXAMPLES
FLOWCHART EXAMPLES
12/21/2023
FLOWCHART EXAMPLES
FLOWCHART EXAMPLES
12/21/2023
FLOWCHART EXAMPLES
FLOWCHART EXAMPLES
12/21/2023
CLASS TEST
12/21/2023
1. Define Algorithm.
2. Define Flowchart.
THANK YOU