Algorithms
Algorithms
What is algorithm?
Advantages of Algorithms
Easy to understand
Independent of programming language
Easy to Debug
Disadvantages of Algorithms
Tools of Algorithm
The two most frequently used tools for understanding the logic of an algorithm program
are pseudocode and flow charts.
Flowcharts & Pseudocode
The two methods are able to be applied as strategies for problem-solving. For simple
tasks, a flowchart is typically used, and for more complicated issues, pseudocode.
Eg.
Your science teacher has asked you to collect some dry leaves for a science project. To
do this task, you need to follow some steps. These are:
Flowcharts
Disadvantages of Flowchart:
It is difficult to draw flowcharts for large and complex programs.
There is no standard to determine the amount of detail.
Difficult to reproduce the flowcharts.
It is very difficult to modify the Flowchart.
Making a flowchart is costly.
Some developer thinks that it is a waste of time.
It makes software processes low.
Connectors reduce the number of flow lines. These must be used to make the
flow chart simple. Avoid the intersection of flow lines.
The flowchart should be easy to follow and neatly made.
Pseudocode
Advantages of Pseudocode
Disadvantages of Pseudocode
Eg.
You have to make a pseudocode for calculating the area of the rectangle. The
pseudocode to calculate the area of the rectangle is given below.
Begin
Display Area
End
Eg.
numbers.
Step 02. S ← A + B (Store the sum of the values in A and B and store in S)
e) Accept the rate for a dozen bananas and the quantity required to determine the cost.