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

Basic Concepts of Algorithm

Uploaded by

Anita Rahayu
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

Basic Concepts of Algorithm

Uploaded by

Anita Rahayu
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 15

Basic Concepts of

Algorithm
G10
 An algorithm is a set of step
by step instructions to solve
a problem.
 An algorithm must specify
Algorithm
every step completely, so a
computer can implement it
without any further
“understanding”
Algorithm Example
1. Prepare 1 pack of instant noodles, 400 ml of water, pot, bowl,
spoon and fork
2. Put 400 ml of water into the pot
3. Cook water
4. Wait until it boils
5. Put the noodles into a pot that already contains boiling water
6. Wait and stir for up to 3 minutes
7. When it's cooked, add the spices
8. Mix well
9. Serve noodles
01

Algorithm Descriptive Sentence

Representati 02
Pseudocode

on 03
Flowchart
Flowchart
Flowchart is a graphical/diagrammatic
representation of algorithm
The form of the diagram in the chart of
a flowchart defines the instructions
given to the computer.
Flowchart have 3 control
structures
Flowchart – Sequence Structure
Sequence involves simple steps which
are to be executed one after the
other.
The steps are executed in the same
order in which they are written
Flowchart Sequence
Example
Flowchart – Selection Structure
Selection is used in a computer
program or algorithm to determine
which particular step or set of
steps is to be executed.
This is also referred to as a ‘decision’.
Flowchart
Flowchart – Loop/Repetition
Structure
The loop allows a statement or a
sequence of statements to be
repeatedly executed based on some
loop condition.
Flowchart – Loop/Repetition
Structure
Let’s say we wish to indicate that you
need to keep filling the kettle with
water until it is full.
We need a loop or iteration
WHILE
If the condition is not true first time
than control will never enter in a
loop.
Initialization and updating is not the
part of the syntax.
WHILE
(condition)
DO
Example - Flowchart

You might also like