When we learn about programming concept, we will often find word "algorithm". What is "algorithm"? Algorithm is sequenced logic steps which explain some tasks to do something or solve some problems. If we can make algorithm easily, we will be able to make program in programming language easily to. Because we just need to translate the algorithm to be written in program maker, for example Turbo Pascal.
Writing Algorithm
We can write algorithm using three ways:
Writing Algorithm
We can write algorithm using three ways:
- Write the algorithm in natural language (English, Melayu, or other human language), but this way is ambiguous generally
- Using flowchart. Flowchart is diagram that show us the logic sequence of a problem solving procedure. This is good visually, but difficult to make if the algorithm too long.
- Using pseudo-code. Pseudo-code is a way to write algorithm using the style of certain programming language, so this way is nearer to programming language. But its negative side is difficult to be understood by people that do not know about programming.
Main Aspect of Algorithm
Algorithm has some aspects that must be had:
- Finiteness, algorithm must be stopped after a finite number of steps.
- Definiteness, each step must be defined correctly and may not be confusing (ambiguous).
- Input, an algorithm has no or more than one input that is given to the algorithm before it is run.
- Output, an algorithm has one or more output, which is depended on the input.
- Effectiveness, every algorithm should be effective
No comments:
Post a Comment