0% found this document useful (0 votes)
2 views

Algorithms and Flow Charts - 03

The document discusses problem-solving techniques, specifically focusing on algorithms and flowcharts. It outlines the properties of algorithms, including finiteness, definiteness, input, output, and effectiveness, and provides examples of simple algorithms. Additionally, it explains flowcharts as a visual representation of algorithms, their advantages in communication and analysis, and limitations such as complexity and the need for modifications.

Uploaded by

korimy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Algorithms and Flow Charts - 03

The document discusses problem-solving techniques, specifically focusing on algorithms and flowcharts. It outlines the properties of algorithms, including finiteness, definiteness, input, output, and effectiveness, and provides examples of simple algorithms. Additionally, it explains flowcharts as a visual representation of algorithms, their advantages in communication and analysis, and limitations such as complexity and the need for modifications.

Uploaded by

korimy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 31

PROBLEM SOLVING TECHNIQUES

ALGORITHM AND FLOW CHART

What is Algorithm?

Algorithm can be defined as: “A sequen


ce of activities to be processed for getting
desired output from a given input.”
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
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.
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.
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.
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.
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.
PROPERTIES OF ALGORITHM

Any algorithm should have all these five


properties otherwise it will not fulfil the
basic objective of solving a problem in finite
time. As you have seen in previous
examples, every step of an algorithm puts
you closer to the solution
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.
ALGORITHM EXAMPLES

Write an algorithm to print “Good Morning‟

Step 1: Start
Step 2: Print “Good Morning‟
Step 3: Stop
ALGORITHM EXAMPLES

Write an algorithm to find area of a rectangle.

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
ALGORITHM EXAMPLES

Write an algorithm to check whether he is


eligible to vote? (more than or equal to 18
years old).
Step 1: Start
Step 2: Take age and store it in age
Step 3: Check age value, if age >= 18 then go
to step 4 else step 5
Step 4: Print “Eligible to vote” and go to
step 6
Step 5: Print “Not eligible to vote”
Step 6: Stop
ALGORITHM EXAMPLES

Write an algorithm to check whether given


number is +ve, -ve or zero.

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
ALGORITHM EXAMPLES

Write an algorithm to check whether given


number is +ve, -ve or zero.

Step 5: Print “Given number is +ve”and go


to step 8
Step 6: Print “Given number is -ve” and go
to step 8
Step 7: Print “Given number is zero”
Step 8: Stop
FLOWCHART
FLOWCHART
The flowchart is a diagram which visually pr
esents the flow of data through processing
systems. This means by seeing a flow chart
one can know the operations performed an
d
the sequence of these operations in a syste
m. Algorithms are nothing but sequence of
steps for solving problems. So a flow chart c
an be used for representing an algorithm. A
flowchart, will describe the operations
(and in what sequence) are required
to solve a given problem.
FLOWCHART
A flowchart is a type of diagram that
represents an algorithm, workflow or
process. The flowchart shows the steps as
boxes of various kinds, and their order by
connecting the boxes with arrows. This
diagrammatic representation illustrates a
solution model to a given problem.
Flowcharts are used in analyzing, designing,
documenting or managing a process or
program in various fields.
BUILDING BLOCKS
OF
FLOW CHART
OR
COMMON SYMBOLS
OF
FLOW CHART
BUILDING BLOCKS OF FLOW CHART

The American National Standards


Institute (ANSI) set standards for flowcharts
and their symbols in the
1960s. The International Organization for
Standardization(ISO) adopted the ANSI
symbols in 1970. The current standard was
revised in 1985. Generally, flowcharts flow
from top to bottom and left to right.
BUILDING BLOCKS OF FLOW CHART
ADVANTAGES OF USING FLOWCHARTS
As we discussed flow chart is used for
representing algorithm in pictorial form.
This pictorial representation of a
solution/system is having many
advantages. These advantages are as
follows:

1. COMMUNICATION.
2. EFFECTIVE ANALYSIS.
3. DOCUMENTATION OF PROGRAM/SYSTEM.
4. EFFICIENT PROGRAM MAINTENANCE.
5. CODING OF THE PROGRAM.
ADVANTAGES OF USING FLOWCHARTS
1. COMMUNICATION:

A Flowchart can be used as a better way of


communication of the logic of a system and
steps involve in the solution, to all concerned
particularly to the client of system.
ADVANTAGES OF USING FLOWCHARTS
2. EFFECTIVE ANALYSIS:

A flowchart of a problem can be used for


effective analysis of the problem.
ADVANTAGES OF USING FLOWCHARTS
3.DOCUMENTATION OF PROGRAM/
SYSTEM:

Program flowcharts are a vital part of a good


program documentation. Program document is
used for various purposes like knowing the
components in the program, complexity of the
program etc.
ADVANTAGES OF USING FLOWCHARTS
4. EFFICIENT PROGRAM
MAINTENANCE:

Once a program is developed and becomes


operational it needs time to time maintenance.
With help of flowchart maintenance become
easier.
ADVANTAGES OF USING FLOWCHARTS
5. CODING OF THE PROGRAM:

Any design of solution of a problem is finally


converted into computer program. Writing code
referring the flowchart of the solution become
easy.
LIMITATIONS OF USING FLOWCHARTS
1) COMPLEXITY OF LOGIC: If program logic is
complex then flowchart of the program
becomes complicated.

2) ALTERATIONS AND MODIFICATIONS IN LOGIC:


any alterations in the program logic may require
redrawing of flowchart completely.

3) REUSE IS NOT POSSIBLE: As the flowchart


symbols cannot be typed, always reproduction of
flowchart symbols are required.
FLOWCHART EXAMPLES
Draw a flowchart to find the simple interest.
(Sequence)
FLOWCHART EXAMPLES
Draw a flowchart to find bigger number
among two numbers (selective)
THANK YOU

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy