Lecture-9(Algorithm and Flowchart)
Lecture-9(Algorithm and Flowchart)
What is Algorithm?
To write a logical step-by-step method to solve the problem is called algorithm, in
other words, an algorithm is a procedure for solving problems. In order to solve a
mathematical or computer problem, this is the first step of the procedure. An
algorithm includes calculations, reasoning and data processing. Algorithms can be
presented by natural languages, pseudo code and flowcharts, etc.
What is Flowchart?
Input / Output
Process / Instruction
Decision
Connector / Arrow
Algorithm Flowchart
It is a procedure for solving problems. It is a graphic representation of a process.
The process is shown in step-by-step The process is shown in block-by-block information
instruction. diagram.
It is complex and difficult to understand. It is intuitive and easy to understand.
It is convenient to debug errors. It is hard to debug errors.
The solution is showcased in natural
The solution is showcased in pictorial format.
language.
It is somewhat easier to solve complex
It is hard to solve complex problem.
problem.
It costs more time to create an algorithm. It costs less time to create a flowchart.
Algorithms are mainly used for mathematical and computer programs, whilst
flowcharts can be used to describe all sorts of processes: business, educational,
personal and of course algorithms. So flowcharts are often used as a program
planning tool to visually organize the step-by-step process of a program.
Algorithm:
Step 1: Initialize X as 0,
Step 2: Increment X by 1,
Step 3: Print X,
Algorithm: