Structure of Algorithm

The algorithm contains a step-by-step solution of a problem. These steps may include the contents of runs (sequences), the action selection (branching / selection) and repetition of actions (loops). The three types of step is the major construction that make up an algorithm. In other words that the algorithm is prepared or can be built from three basic structures, namely:

1. Of runs (sequences)

2. Elections (branching / selection)

3. Repetition (loops)

Description of each basic structure will be described below.


Ssequential

The runs consist of one or more instructions. Each instruction is done sequentially in the order written. Instruction sequence determines the final state of the algorithm. If the order is changed, the end result will also change. As an example consider the sequence of instructions denoted by A1, A2, A3, A4 and A5.

The process begins with the process in A1 only then do instruction A2, A3 selanjutna A2 will be done after the instruction is completed and so on and will stop after instruction A5 completed
.

0 comments



Recent Entries